jQuery实现锚点向下平滑滚动特效示例
(编辑:jimmy 日期: 2025/11/7 浏览:3 次 )
实现效果:
实现原理:
使用jQuery animate()方法实现页面平滑滚动特效
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
window.location.hash = hash;
});
简单实例代码:
<!DOCTYPE html> <html> <head> <script src="/UploadFiles/2021-04-02/jquery.min.js">以上这篇jQuery实现锚点向下平滑滚动特效示例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
下一篇:js使用html2canvas实现屏幕截取的示例代码
