jquery鼠获取标滚轮次数(1)
来源:互联网 发布:2016年4月1日非农数据 编辑:程序博客网 时间:2024/06/01 15:24
这里使用了mousewheel的jquery插件。网址是:http://www.jq22.com/jquery-info805
功能描述:获取鼠标滚动次数。
所需要的引用的文件是:
1.jquery.min.js
2.jquery-mousewheel.js
结果图片:
html代码:
<!DOCTYPE html>
<html lang="zh-CN">
<meta http-equiv="Content-type" content="text/html" charset="utf-8" >
<head>
<title>获取滚轮次数</title>
<style>
.box { width: 600px; height: 300px; background-color: #eed; }
</style>
</head>
<body>
<div class="box">
<p>滚动鼠标为+1或者-1</p>
<span>0</span>
</div>
</body>
<script type="text/javascript" src="script/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="script/jquery-mousewheel.js"></script>
<script type="text/javascript" src="script/test.js"></script>
</html>
test.js代码:
$(function(){
var len = 0;
var $box = $('.box');
var $text = $('.box span');
$box.mousewheel(function(y){
len += y;
if(y>0){
//alert(len);
$text.html(len);
}else{
$text.html(len);
}
});
});
- jquery鼠获取标滚轮次数(1)
- jquery 鼠标滚轮事件
- jquery实现滚轮监听
- JQuery鼠标滚轮事件
- jquery 监测鼠标滚轮
- jquery监听鼠标滚轮
- jQuery实现位移滚轮
- jquery滚轮实现图片缩放
- jQuery 鼠标滚轮插件 mousewheel
- 鼠标滚轮插件jQuery mousewheel
- 鼠标滚轮事件----jquery-mousewheel
- jQuery监听鼠标滚轮事件
- jQuery 鼠标滚轮插件 mousewheel
- 获取鼠标滚轮滑动距离
- Android5.1应用打开次数获取
- 获取用户登录次数(cookie)
- jQuery底部带导航的图片切换,定时上下滚动效果(无滚轮切换效果)
- jQuery通过滚轮滚动动态加载图片
- mongoDB报错Cannot find module '../build/Release/bson'
- openfire+spark+smack实现即时通讯
- Leetcode[63]-Unique Paths II
- Docker入门实战
- struggle in a slave school =>长期更新
- jquery鼠获取标滚轮次数(1)
- Java数据库连接池dbcp的用法
- 父亲节就快到了,为老爸接力一下好吗?
- HDU-1049-Climbing Worm(C++ && 编程初学者的题......)
- JSON 字符串 与 java 对象的转换
- Android学习 6->浅谈界面显示与LayoutInflater
- Build HSS and Config Phpmyadmin
- Spark入门——5 SparkSQL
- 九度OJ-题目1509:树中两个结点的最低公共祖先