V
viza
Hi!
I use the onscroll event to make something like the CSS position:fixed; for
MSIE.
In MSIE/5.5, before a function is assigned to the event handler, it has the
value null. In Opera, it is undefined, because Opera doesn't support this
event.
I use:
if(window.onscroll===undefined || some_other_stuff)
do_something_else()
else
window.onscroll=myfunction
to check if it will work. Now this works in MSIE/5.5 and Opera, but in
MSIE/5.0, it seems that the keyword 'undefined' is itself not defined.
***
How can I test for the presence of this event handler without causing an
error mesage in MSIE/5.0 ?
***
Obviously, just if(window.onscroll) won't work because both undefined and
null are boolean false.
You can see this in action (or not) at:
http://www.touchwoodfurniture.co.uk/
This site is new, so any other comments are welcomed.
The script is:
http://www.touchwoodfurniture.co.uk/scripts/ie5_foot.js
(The equiv. for other browsers is css2_foot.js)
Thanks!
Tom Vajzovic <webmaster@[the above domain]>
I use the onscroll event to make something like the CSS position:fixed; for
MSIE.
In MSIE/5.5, before a function is assigned to the event handler, it has the
value null. In Opera, it is undefined, because Opera doesn't support this
event.
I use:
if(window.onscroll===undefined || some_other_stuff)
do_something_else()
else
window.onscroll=myfunction
to check if it will work. Now this works in MSIE/5.5 and Opera, but in
MSIE/5.0, it seems that the keyword 'undefined' is itself not defined.
***
How can I test for the presence of this event handler without causing an
error mesage in MSIE/5.0 ?
***
Obviously, just if(window.onscroll) won't work because both undefined and
null are boolean false.
You can see this in action (or not) at:
http://www.touchwoodfurniture.co.uk/
This site is new, so any other comments are welcomed.
The script is:
http://www.touchwoodfurniture.co.uk/scripts/ie5_foot.js
(The equiv. for other browsers is css2_foot.js)
Thanks!
Tom Vajzovic <webmaster@[the above domain]>