jimbob2812
10-09-2003, 07:06 AM
I am writting a sticky menu and so need to "sniff out" the browser. The browser I am currently testing on is ie6.0.
On surfing the web, I have gathered the way to implement the sticky menu is "document.documentElement.scrollTop" - at least for ie6.0...
It is suggested to use "if (document.documentElement && document.documentElement.scrollTop)" to determine if ie6.0 is being used, and if so to access the scrollTop property.
However, the detection part does not work. The scrollTop property is indeed what I need to use (proven by forcing the code to be executed) however all the pages say that the detection method should work, although it does not for me!
Please, does anyone have any ideas? One thought I had was it may be linked to DOCTYPE definition - I am currently using strict XHTML, although even when I remove the DTD, it still does not sniff out the scrollTop property correctly, even though the code still works...
On surfing the web, I have gathered the way to implement the sticky menu is "document.documentElement.scrollTop" - at least for ie6.0...
It is suggested to use "if (document.documentElement && document.documentElement.scrollTop)" to determine if ie6.0 is being used, and if so to access the scrollTop property.
However, the detection part does not work. The scrollTop property is indeed what I need to use (proven by forcing the code to be executed) however all the pages say that the detection method should work, although it does not for me!
Please, does anyone have any ideas? One thought I had was it may be linked to DOCTYPE definition - I am currently using strict XHTML, although even when I remove the DTD, it still does not sniff out the scrollTop property correctly, even though the code still works...