且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

降低Jquery Scroll的速度

更新时间:2023-02-04 18:36:24

在本节的第三行中,更改1000:

In this section's third line, change 1000:

// If at last section, scroll back to top on next click:
if (nextSection >= $scrollSection.length) {
  $('html, body').animate({ scrollTop: 0 }, 1000);
  nextSection = 0;
  return;
}

$(document).height(),就像这样:

  $('html, body').animate({ scrollTop: 0 }, $(document).height());

这将使动画以每秒约1000像素的速度滚动.

this will make the animation scroll at about 1000 pixels per second.