[英]jquery get window scroll position after clicking on internal link
I am trying to get scroll position after I click on anchor (internal click). 单击锚点(内部点击)后,我试图获取滚动位置。
$(".nav-link").click(function(){
console.log($(window).scrollTop());
});
But the value is the one of the position before the scroll is done. 但是该值是滚动完成之前的位置之一。 How can I get the value when the event is completed? 活动结束后如何获得价值?
window.onhashchange = function () {
console.log($(window).scrollTop());
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.