标签:div 距离 osi class ons 高度 fun fixed 滚动条事件
window.onscroll = function (ev) {
//console.log("距离顶部的高度:"+$(document).scrollTop());
var heightY = $(document).scrollTop();
var x = $(document).scrollLeft();
if(heightY > 0){
console.log("距离顶部的高度:"+heightY);
$("#threadId").css("position","fixed");
}
if(x > 0 ){
console.log("距离左边:"+x);
$("#threadId").css("position","static");
}
}
滚动条滚动时,发生的事件
标签:div 距离 osi class ons 高度 fun fixed 滚动条事件
原文地址:https://www.cnblogs.com/lazyli/p/11683394.html