Detecting scroll in Jquery Mobile

Posted by noway on Stack Overflow See other posts from Stack Overflow or by noway
Published on 2012-11-15T22:57:45Z Indexed on 2012/11/15 22:59 UTC
Read the original article Hit count: 150

Filed under:
|

I can't detect whether the page is scrolled or not with jquery mobile. Scrolltop always return 0 in any case.

    <script>


        var interval = setInterval(function() {

                                   alert($("#articlecontent").scrollTop());
                                   //alert($(window).scrollTop());
                                   //alert($("#maindiv").scrollTop());

                                   }
                                   }, 3000);

    </script>



    <div data-role="page" id="maindiv">
        <div  class="ui-bar ui-bar-b">


        </div>


        <div id='articlecontent' data-role="content" data-iscroll>

          sldfjlkjsl lksjd kls df hjks djkh sdjfkh sjkf 
          jksd jkhsdf jkhsd hjwiuhhfg skd jkshd fkj fkjsg kjhsdkjf 

          sldfjlkjsl lksjd kls df hjks djkh sdjfkh sjkf 
          jksd jkhsdf jkhsd hjwiuhhfg skd jkshd fkj fkjsg kjhsdkjf 


          sldfjlkjsl lksjd kls df hjks djkh sdjfkh sjkf 
          jksd jkhsdf jkhsd hjwiuhhfg skd jkshd fkj fkjsg kjhsdkjf 



        </div>
        <div data-role="footer" data-id="foo1">


        </div>
    </div>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-mobile