1. #1
    Sencha User
    Join Date
    Jan 2008
    Posts
    8
    Vote Rating
    0
    cybertaz is on a distinguished road

      0  

    Default Unanswered: Browser Window Scroll Event

    Unanswered: Browser Window Scroll Event


    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

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Answers
    13
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    Code:
    Ext.fly(document).on("scroll", function(){console.log("body scrolled");});

  3. #3
    Sencha User
    Join Date
    Jun 2009
    Posts
    21
    Vote Rating
    0
    vocabo is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    Code:
    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);
    }

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Answers
    13
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    OK, so IE doesn't fire document scroll? Still, do it right. Don't use inline listeners.

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

Thread Participants: 2