jQuery scroll() detect when user stops scrolling

前端 未结 13 1616
情歌与酒
情歌与酒 2020-11-22 02:17

Ok with this..

$(window).scroll(function()
{
    $(\'.slides_layover\').removeClass(\'showing_layover\');
    $(\'#slides_effect\').show();
});
13条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 02:53

    For those Who Still Need This Here Is The Solution

      $(function(){
          var t;
          document.addEventListener('scroll',function(e){
              clearTimeout(t);
              checkScroll();
          });
          
          function checkScroll(){
              t = setTimeout(function(){
                 alert('Done Scrolling');
              },500); /* You can increase or reduse timer */
          }
      });

提交回复
热议问题