Skip to content

Commit ef13e9c

Browse files
committed
Remove dependency on jQuery event/alias module
1 parent ddcb162 commit ef13e9c

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

jquery.mousewheel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@
8181

8282
$.fn.extend({
8383
mousewheel: function(fn) {
84-
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
84+
return fn ? this.on('mousewheel', fn) : this.trigger('mousewheel');
8585
},
8686

8787
unmousewheel: function(fn) {
88-
return this.unbind('mousewheel', fn);
88+
return this.off('mousewheel', fn);
8989
}
9090
});
9191

jquery.mousewheel.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/browserify/index.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
<script src="bundle.js"></script>
2-
<script>
3-
$(document).bind('mousewheel', function(e) { console.log(e); });
4-
</script>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Mouse Wheel - Browserify Test</title>
6+
<script src="bundle.js"></script>
7+
<script>
8+
$(function(){
9+
$(document).on('mousewheel', function(e) { console.log(e); });
10+
});
11+
</script>
12+
</head>
13+
<body>
14+
15+
</body>
16+
</html>

test/scroll.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
$('#emulated').append(html);
3333
$('#native').append(html);
3434
}
35-
$('#emulated').bind('mousewheel', function(event) {
35+
$('#emulated').on('mousewheel', function(event) {
3636
event.preventDefault();
3737
var scrollTop = this.scrollTop;
3838
this.scrollTop = (scrollTop + ((event.deltaY * event.deltaFactor) * -1));

0 commit comments

Comments
 (0)