PDA

View Full Version : Browser Window Scroll Event



cybertaz
18 Sep 2009, 10:43 PM
I'm new to ext and I'm wondering if there is a cross-browser way of getting the scroll event when the browser window is scrolled.

I want to implement a static/fixed panel on our site, but position: fixed is not working on all browsers. Also the div should be scrolled untill it reaches the top of the viewing area and then become fixed/static. Something exactly like extjs.com had on the seminar registration page. That page is not live anymore, so I can't look at it for an example.

Thank you for your time and help

Animal
19 Sep 2009, 3:16 AM
Ext.fly(document).on("scroll", function(){console.log("body scrolled");});

vocabo
25 Oct 2009, 8:52 AM
Ext.fly(document).on("scroll", function(){console.log("body scrolled");});


Doesn't work in ie6.
The pure javascript way can be used here
window.onscroll = function() {
alert(document.body.scrollTop);
}

Animal
29 Oct 2009, 4:16 AM
OK, so IE doesn't fire document scroll? Still, do it right. Don't use inline listeners.



Ext.fly(window).on("scroll", function(){console.log("Window scrolled");})