window.addEventListener("scroll",function(e){
var t =document.documentElement.scrollTop||document.body.scrollTop;
if(t <=0){
}else{
alert('到达顶部');
}
});
window.addEventListener("scroll",function(e){
var t =document.documentElement.scrollTop||document.body.scrollTop;
if(t <=0){
}else{
alert('到达顶部');
}
});
本文标题:监听屏幕距离顶部距离
本文链接:https://www.haomeiwen.com/subject/khjujftx.html
网友评论