dekevin

当用户在设备上滚动页面时,jQuery Mobile提供了滚动事件进行监听。其中首先介绍的是scrollstart事件,该事件发生在页面滚动开始时,如下代码:

 $(document).ready(function(){

  $(\'body\').bind(\'scrollstart\', function(event) {

  //相关的滚动开始代码

  });

  });

同样,当滚动停止后,则可以用scrollstop事件进行监听,如下代码:

 $(document).ready(function(){

  $(\'body\').bind(\'scrollstop\', function(event) {

  //相关滚动停止的代码

  });

  });

分类:

技术点:

相关文章: