滚动条滚动到底部和顶部
来源:互联网 发布:淘宝投诉电话人工服务 编辑:程序博客网 时间:2024/05/22 02:05
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script src="jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(window).scroll(function() {
//$(document).scrollTop() 获取垂直滚动的距离
//$(document).scrollLeft() 这是获取水平滚动条的距离
if ($(document).scrollTop() <= 0) {
alert("滚动条已经到达顶部为0");
}
if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
alert("滚动条已经到达底部为" + $(document).scrollTop());
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 3000px; background-color: skyblue;">
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script src="jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(window).scroll(function() {
//$(document).scrollTop() 获取垂直滚动的距离
//$(document).scrollLeft() 这是获取水平滚动条的距离
if ($(document).scrollTop() <= 0) {
alert("滚动条已经到达顶部为0");
}
if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
alert("滚动条已经到达底部为" + $(document).scrollTop());
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 3000px; background-color: skyblue;">
</div>
</form>
</body>
</html>
0 0
- 滚动条滚动到底部和顶部
- js滚动条滚动到底部和顶部
- div内部滚动条滚动到底部和顶部
- Android ScrollView滚动条控件,滚动到底部或顶部
- jquery 滚动条 平滑滚动到顶部、底部、置顶位置
- 阻止在div上滚动滚动条,到底部和顶部带动整个页面的滚动条
- 滚动条到底部
- jquery判断滚动条是否到达窗口顶部和底部
- android ListView滚动条监听判断滚动到底部还是顶部
- ScrollView滚动到底部和顶部的检测
- Android 控制ScrollView滚动到底部和顶部
- [Android] ScrollView滚动到底部和顶部的检测
- ListView滚动到顶部和底部的判断
- UIScrollView ,UITableView 和 UICollectionView 如何滚动到顶部或底部
- iOS-UITableView 滚动到底部和顶部的方法
- Android设置ScrollView滚动到底部和顶部
- 滚动条滚动到最底部
- 将滚动条滚动到最底部
- 如何解决failed to push some refs to git
- C#的引用类型和值类型
- NSTimer 在使用中需要注意的几个问题
- MIME TYPE的常用。
- UIScrollView被我忽略的一个属性
- 滚动条滚动到底部和顶部
- CORDOVA介绍
- 玩转spring boot——结合阿里云持续交付_0
- 洛谷 P1282 多米诺骨牌
- 在C++中子类继承和调用父类的构造函数方法
- Centos7 下zookeeper3.4.9集群搭建
- 11300 - Spreading the Wealth
- HTML基础知识
- study-26:XenServer应用