This is a quick compatibility issue that anybody who knows the ins and outs of Javascript and CSS will know immediately.
What I'm trying to modify below, isn't being modified in FF, but it is in IE...is there a quick fix to this?
Code://GET THE STYLESHEET var mysheet=document.styleSheets["mainSheet"]; var myrules=mysheet.cssRules? mysheet.cssRules: mysheet.rules; //THE TOGGLE FUNCTION function toggle (whichDiv,show) { var rule = "#" + whichDiv; //THE NAME OF THE DIV TO SHOW for (i=0; i<myrules.length; i++) { if (myrules[i].selectorText.toLowerCase()=="#infohovers") { var infoHovers = myrules[i]; infoHovers.style.display = show; } if (myrules[i].selectorText.toLowerCase()==rule){ var targetrule = myrules[i]; if (show == "block") { targetrule.style.zIndex = 1000; } else { targetrule.style.zIndex = 0; } break; } } } function showDiv(whichDiv) { toggle(whichDiv,"block"); } function hideDiv(whichDiv) { toggle(whichDiv,"none"); } //-->


Reply With Quote
My bad. Looking in the Firefox DOM Inspector for this page actually, I notice that the document.styleSheets object is actually an array of integer indexed style sheets. Try throwing myrules into an alert box and see what it shows.
Bookmarks