Firefox onscroll

Discussion in 'Javascript' started by Simon Wigzell, Sep 27, 2005.

  1. Firefox has strange behaviour with onscroll. I have a sample page here:
    http://www.dynamicwebsitesystems.com/ScrollTest.htm

    If I make this the startup page for the firefox browser or launch it from
    Frontpage with Preview then the onscroll works - it calls the doOnScroll
    function and posts the alert when you move the scroll bar. It doesn't work
    if you go to this page from another page or if you refresh the page. What is
    going on here? Any way to make it work all the time?

    Thanks!
     
    Simon Wigzell, Sep 27, 2005
    #1
    1. Advertising

  2. Simon Wigzell <> wrote in message news:96g_e.269528$Hk.230298@pd7tw1no...
    > Firefox has strange behaviour with onscroll. I have a sample page here:
    > http://www.dynamicwebsitesystems.com/ScrollTest.htm
    >
    > If I make this the startup page for the firefox browser or launch it from
    > Frontpage with Preview then the onscroll works - it calls the doOnScroll
    > function and posts the alert when you move the scroll bar. It doesn't work
    > if you go to this page from another page or if you refresh the page. What is
    > going on here? Any way to make it work all the time?
    >
    > Thanks!
    >



    It's clumsy to display an alert for every event.
    I can't test this, but try writing it like this:

    <script type="text/javascript">

    function doOnScroll()
    {
    window.onscroll=null;
    alert("Scrolled");
    }

    window.onscroll = doOnScroll;

    </script>

    --
    S.C.
     
    Stephen Chalmers, Sep 28, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    5,888
  2. Sam
    Replies:
    2
    Views:
    2,873
    IT Guy
    Sep 29, 2006
  3. Mark Szlazak
    Replies:
    1
    Views:
    156
    Mark Szlazak
    Mar 30, 2005
  4. Simon Wigzell

    window.onscroll and firefox

    Simon Wigzell, Sep 1, 2005, in forum: Javascript
    Replies:
    4
    Views:
    277
    GĂ©rard Talbot
    Sep 2, 2005
  5. Jeremy

    Firefox, textarea and onscroll

    Jeremy, Jul 6, 2006, in forum: Javascript
    Replies:
    1
    Views:
    109
    Martin Honnen
    Jul 6, 2006
Loading...

Share This Page