I am trying to trigger the onScroll event this way using prototype:
Event.observe(document, 'scroll', function(){
alert('boo');
});
It works perfectly on Firefox, but nothing happens on IE. Does anyone know why? and if there is another way to do so?
Thanks
Try attaching it to the window
instead:
Event.observe(window, 'scroll', function() {
alert('boo');
});
Works for me on IE, FF. Honestly, I don't know why it would work attaching it to the document
.
Don't know if anyone is still following this answer, but i thought i would put down some of the information i found. In general the scroll event is supported on "window" on the following browsers below...
However, when it comes to the document, it is not supported on any of the IE versions. Now, the funny thing is the Iphone 3G browser is the reverse of IE. The scroll event only works on the document. For more info on this, check out http://www.quirksmode.org. This site has alot of good stuff on event handling. Hope this helps someone...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With