Detecting scroll in Jquery Mobile
- by noway
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>