pixelEngine
06-05-2006, 11:14 PM
Ok, I have a tabbed menu that has a different class on the tab that is active.
here is the html:
<div id="menu">
<ul id="navtabs">
<li id="yourcar" class="activelink"><a href="javascript:sndReq('yourcar')">Car</a></li>
<li id="wheels"><a href="javascript:sndReq('wheels')">Wheels</a></li>
<li id="tires"><a href="javascript:sndReq('tires')">Tires</a></li>
<li id="paint"><a href="javascript:sndReq('paint')">Paint</a></li>
</ul>
</div>
So as you can see from the above, 4 tabs - each with a id. The active tab has the class="activelink" attached to the <li>.
here is the JS function sndReq()::
function sndReq(action) {
//strip all classes
document.getElementById("yourcar").removeAttribute("class");
document.getElementById("tires").removeAttribute("class");
document.getElementById("wheels").removeAttribute("class");
document.getElementById("paint").removeAttribute("class");
//set class on clicked item
document.getElementById(action).setAttribute("class","activelink");
}//END sndReq
It works great in Firefox, but IE no likey. Is there a way around this?
Thnks for any tips! :rolleyes:
here is the html:
<div id="menu">
<ul id="navtabs">
<li id="yourcar" class="activelink"><a href="javascript:sndReq('yourcar')">Car</a></li>
<li id="wheels"><a href="javascript:sndReq('wheels')">Wheels</a></li>
<li id="tires"><a href="javascript:sndReq('tires')">Tires</a></li>
<li id="paint"><a href="javascript:sndReq('paint')">Paint</a></li>
</ul>
</div>
So as you can see from the above, 4 tabs - each with a id. The active tab has the class="activelink" attached to the <li>.
here is the JS function sndReq()::
function sndReq(action) {
//strip all classes
document.getElementById("yourcar").removeAttribute("class");
document.getElementById("tires").removeAttribute("class");
document.getElementById("wheels").removeAttribute("class");
document.getElementById("paint").removeAttribute("class");
//set class on clicked item
document.getElementById(action).setAttribute("class","activelink");
}//END sndReq
It works great in Firefox, but IE no likey. Is there a way around this?
Thnks for any tips! :rolleyes: