Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下代码滚动到元素的顶部,但我想在元素顶部上方滚动 10px,不知道该怎么做,有什么建议吗?谢谢!
$('html, body').stop(true,true).animate({ scrollTop: $(".career-overlay").offset().top }, 2000)
像这样:
$('html, body').stop(true,true).animate({ scrollTop: $(".career-overlay").offset().top - 10 }, 2000)