Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

name <td> to later call it and change an attribute pt 2

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
okay, i changed the code as follows...


function mynavon(page){

el = document.getElementById("box1");
el.style.backgroundColor = 'red';


if (self.location == page) el.style.bgColor = 'red';

}

each <td> in the nav bar table gets assigned a specific id and...cool, it works, so the nav bar option corresponds to the page...ex: if you go to 'sample.html', the button selection on the nav bar named 'sample' turns red, and so on...

the problem? it requires the user to have the latest and greatest browser version. anyone suggest another way?

- crispy

 
well... you can make it work for IE4 also by testing for IE4 and saying simply:

box1.style.backgroundColor = 'red';

don't bother with ns4. ns4 is a terrible excuse for a browser (though you could do it with a healthy barage of <slayer> tags and some document.layrername.bgColor hacks) and you shouldn't waste your time writing dhtml for it. Force users to upgrade for dhtml:

jared@eae.net -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top