<!DOCTYPE html>
<html>
<head>
<title>jQuery 鼠标滚轮插件 mousewheel</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.mousewheel {
background: green;
200px;
height: 200px;
}
</style>
</head>
<body>
<div class="mousewheel"></div>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/jquery-mousewheel/3.1.13/jquery.mousewheel.js"></script>
<script type="text/javascript">
$('.mousewheel').bind('mousewheel', function(event, delta) {
var dir = delta > 0 ? 'Up' : 'Down';
if (dir == 'Up') {
$('.mousewheel').text('Up');
} else {
$('.mousewheel').text('Down');
}
});
</script>
</body>
</html>
备注:欢迎加入web前端求职招聘qq群:668352707