I have a row of tabs that have descending zIndex (100, 99, 98) so that they over lap each other a little.
Problem is, I want to have the current (active) tab on the top so it overlaps the ones before and after it.
onchange of a tab I am doing this
var len = tabs.length;
var tab;
for(var j=0;j<len;j++){
tab = tabs[j];
tab.className = “tab”
tab.style.zIndex = (100 – j);
alert(tab.style.zIndex);
}
//el is the Current Tab
el.className = “tab_on”;
el.style.zIndex = 1000;
Css Classes tab and tab_on both have position:relative and margin-left:-8px (the overlap effect). The only difference is colors and fonts.
Why is the zIndex change in javascript not working? Please help?