【发布时间】:2019-02-12 01:30:45
【问题描述】:
我使用非常标准的 scrolltop sn-p 运行到我的某些页面上的某些部分,但我还有一些使用锚点的其他功能(例如音频播放器的播放按钮、共享链接、滑块箭头)
有没有办法改进 sn-p 处理锚点的方式?也许是与特殊课程或其他什么的链接?
$('a[href^="#"]').click(function(){
var the_id = $(this).attr("href");
$('html, body').animate({
scrollTop:$(the_id).offset().top - 100
}, 'slow');
return false;});
【问题讨论】:
标签: anchor scrolltop anchor-scroll