Jquery自动滚动

时间:2013-06-23 18:26:29

标签: jquery scroll anchor bind

我正在寻找一种像这样滚动页面的方法: http://theartofraw.g-star.com

我还没有办法解决它。

我尝试了以下内容:

function scrollToAnchor(){ 
  $('body').bind('mousewheel', function(e){

  if(e.originalEvent.wheelDelta < 0) {

  $(document.body).animate({'scrollTop':  $('#js-anchor').offset().top}, 1000);

  state = 'scrolled';

  }else {
     //scroll up
     console.log('Up');
  }

    //prevent page fom scrolling
    return false;
  });

}

期待一些提示。

提前谢谢: - )

1 个答案:

答案 0 :(得分:0)

查看this或使用jquery plugin

相关问题