jQuery实现锚点向下平滑滚动特效示例

实现效果:

jQuery实现锚点向下平滑滚动特效示例_第1张图片

实现原理:

使用jQuery animate()方法实现页面平滑滚动特效

$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
window.location.hash = hash;
});

简单实例代码:






 


点击此处平滑滚动到第二部分
SECTION 2

以上这篇jQuery实现锚点向下平滑滚动特效示例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

你可能感兴趣的:(jQuery实现锚点向下平滑滚动特效示例)