scrollTop上移和下移
来源:互联网 发布:中国五矿待遇知乎 编辑:程序博客网 时间:2024/06/06 04:28
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style>
textarea {
width:200px;height:100px;
}
</style>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<meta charset="utf-8" />
</head>
<body>
<div> <span class="xx">向下</span><span class="xs">向上</span></div>
<br />
<hr />
<textarea id="id1">
123。
</textarea>
<script>
$(function () {
var $er = $("#id1");
$(".xs").click(function () {
if (!$er.is(":animated")) {
if ($er.scrollTop() > 50) {
$er.animate({ scrollTop: "-=50" }, 1000);
}
}
});
$(".xx").click(function () {
if (!$er.is(":animated")) {
if ($er.scrollTop() < 500) {
$er.animate({ scrollTop: "+=50" }, 1000);
}
}
});
})
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style>
textarea {
width:200px;height:100px;
}
</style>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<meta charset="utf-8" />
</head>
<body>
<div> <span class="xx">向下</span><span class="xs">向上</span></div>
<br />
<hr />
<textarea id="id1">
123。
</textarea>
<script>
$(function () {
var $er = $("#id1");
$(".xs").click(function () {
if (!$er.is(":animated")) {
if ($er.scrollTop() > 50) {
$er.animate({ scrollTop: "-=50" }, 1000);
}
}
});
$(".xx").click(function () {
if (!$er.is(":animated")) {
if ($er.scrollTop() < 500) {
$er.animate({ scrollTop: "+=50" }, 1000);
}
}
});
})
</script>
</body>
</html>
阅读全文
0 0
- scrollTop上移和下移
- php 实现上移和下移
- 表格中的上移和下移
- 类google的上移和下移
- datagrid实现行的上移和下移
- js小效果:上移和下移!
- listBox 上移下移
- div 上移下移技术
- table : 上移,下移,置顶
- jquery select 上移下移
- jquery 控制 上移 下移
- 上移下移操作
- flexgrid的上移下移
- ExtJS4 grid 上移下移
- jquery,js上移下移
- jquery select 上移下移
- jquery select 上移下移
- 思想上移,行动下移!
- 【机器学习PAI实践九】如何通过机器学习实现云端实时心脏状况监测
- OpenCV中的Resize函数和Reshape函数
- java多线程之sleep(long millis)方法
- imgproc模块--可倾斜边界
- 使用squid搭建yum源代理服务器和客户端
- scrollTop上移和下移
- windows环境下 apache配置https协议
- java可视化编程-eclipse安装windowbuilder插件
- 对TCP/IP协议的深入浅出总结
- Oracle 行转列pivot 、列转行unpivot 的Sql语句总结
- postman中 form-data、x-www-form-urlencoded、raw、binary的区别
- java 正则表达式
- linux硬盘恢复工具 testdisk
- 税务打印机