472,993 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

changin the onclick link

Hi Gurus and Folk

I have the following line of code:

<A HREF="#fac" CLASS="m" ONCLICK="showD('bas','fac');this.blur();return
false;">show information</A>

the showD function shows a div. People without Javascript are linked to the
#fac bookmark.

Now, I would really love to change the colour/size/position of the show
information text, to show the user they are currently looking at the #fac
section of the page, but as usual, have no idea where to start.

I could use :visited, but that would not be as effective (e.g. if they
choose another option then the #fac would still be visited).

TIA
- Nicolaas
Jul 23 '05 #1
1 1326

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:6W*******************@news.xtra.co.nz...
Hi Gurus and Folk

I have the following line of code:

<A HREF="#fac" CLASS="m" ONCLICK="showD('bas','fac');this.blur();return
false;">show information</A>

the showD function shows a div. People without Javascript are linked to the #fac bookmark.

Now, I would really love to change the colour/size/position of the show
information text, to show the user they are currently looking at the #fac
section of the page, but as usual, have no idea where to start.

I could use :visited, but that would not be as effective (e.g. if they
choose another option then the #fac would still be visited).

TIA
- Nicolaas

I guess if I have alienated the entire www population, I just have to answer
my own questions....

Here is what I did:

function showD(b,el, m, a){
// b = the ID of the content DIV
// el = the div element
// m the ID of the menu DIV, and
// a the link within the menu that makes it happen (i.e. the one that should
be highlighted
var d = 'none'
if (el == 'all'){
d = ''
}
var bRef = null;
if (document.getElementById) {
bRef = document.getElementById(b);
} else {
bRef = document.all[b];
}
if(bRef.childNodes){
var z = bRef.childNodes;
for (var i=0;i<z.length; i++) {
if (z[i].nodeName =='DIV' && z[i].style) {
z[i].style.display = d;
if (z[i].id == el) z[i].style.display = '';
}
}
}//change the actual href
var mRef = null;
if (document.getElementById) {
mRef = document.getElementById(m)
} else {
mRef = document.all[m];
}
if(mRef.childNodes){
var z = mRef.childNodes;
for (var i=0;i<z.length; i++) {
if (z[i].nodeName =='A' && z[i].className) {
z[i].className = 'm';
if (z[i].id == a) z[i].className = 'ms';
}
}
return true;
}
}

The Onclick is now:

<A HREF="#fac" ONCLICK="return !showD('bas','fac', 'men', 'afac');">

any comments greatly appreciated.

- Nicolaas
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to...
2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
1
by: Aftab Alam | last post by:
Hello All I want to change the keyboard layout dynaically, ie if a use focuses on my application the keyboard layout gets set to Arabic and if on any other application it should be english ?? How...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.