OK...here's the background:
I want to use javascript to write a CSS dropdown menu. Since I want to be able to float the menu to either the left or the right depending on the site I am using it on, I need to grab the float value (either right or left) from a stylesheet.
I know I can simply add a variable to the script and be done, but now I just want to see if this can be done. This would be a very useful function for other javascript programs as well.
The only pain in my behind is Internet Explorer. In Netscape, Opera, and Firefox, I can simply use
document.styleSheets[i].cssRules[j].style.getPropertyValue('float');
Is there an Internet Explorer equivalent for this? I have spent two days googling for this with no glory.
So far in internet explorer, I can get as far as retrieving the selector...but I just can't figure out how to get a specific property from it to use in a conditional statement. i.e.
if (property == 'right) { do this; }
else { do that; }
To get the selector in IE, I use this:
document.styleSheets[i].rules[j].selectorText;
I just need that final snippet!
Thanks.