
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8 />
<title>testjQuery</title>
<style>
body{
height: 1111px;
}
</style>
<script src="jquery-180minjs"></script>
<script>
$(window)scroll(function ()
{
var st = $(this)scrollTop();
consolelog(st);
});
</script>
</head>
<body>
<textarea id="area">11</textarea>
</body>
</html>
这个是兼容的 我公司的项目就用的这个获取的。 function ScollPostion() {//滚动条位置 var t, l, w, h; if (documentdocumentElement && documentdocumentElementscrollTop) { t = documentdocumentElementscrollTop; l = documentdocumentElementscrollLeft; w = documentdocumentElementscrollWidth; h = documentdocumentElementscrollHeight; } else if (documentbody) { t = documentbodyscrollTop; l = documentbodyscrollLeft; w = documentbodyscrollWidth; h = documentbodyscrollHeight; } return { top: t, left: l, width: w, height: h }; }
以上就是关于jquery滑动鼠标获取滚动条离顶端的距离全部的内容,包括:jquery滑动鼠标获取滚动条离顶端的距离、jquery滚动条在指定高度滚动、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)