Permalink
Browse files

Actually remove event handlers on removeOverscroll. Closes #28

  • Loading branch information...
1 parent 6d5f41a commit bdb793b5a5aae5e458653cda85f23551b4927e22 Jonathan Azoff committed Nov 5, 2011
Showing with 23 additions and 23 deletions.
  1. +1 −1 demo.html
  2. +10 −10 jquery.overscroll.js
  3. +12 −12 jquery.overscroll.min.js
View
@@ -233,7 +233,7 @@
//showThumbs: false,
scrollLeft: 200,
scrollTop: 100
- }).bind('overscroll:dragstart overscroll:dragend overscroll:driftstart overscroll:driftend', function(event){
+ }).on('overscroll:dragstart overscroll:dragend overscroll:driftstart overscroll:driftend', function(event){
console.log(event.type);
});
$("#link").click(function(){
View
@@ -35,7 +35,7 @@
// removes overscroll from a jQuery object
$.fn.removeOverscroll = function (options) {
return this.each(function () {
- var remover = $(this).data(o.removerKey);
+ var remover = $(this).data(o.removerKey);
if ($.isFunction(remover)) {
remover();
}
@@ -107,10 +107,10 @@
position: 'relative',
overflow: 'hidden',
cursor: options.cursor
- }).bind(o.events.wheel, data, o.wheel)
- .bind(o.events.start, data, o.start)
- .bind(o.events.end, data, o.stop)
- .bind(o.events.ignored, false);
+ }).on(o.events.wheel, data, o.wheel)
+ .on(o.events.start, data, o.start)
+ .on(o.events.end, data, o.stop)
+ .on(o.events.ignored, false);
if (options.showThumbs) {
@@ -147,10 +147,10 @@
target
.removeAttr('style')
.removeData(o.removerKey)
- .unbind(o.events.wheel, o.wheel)
- .unbind(o.events.start, data, o.start)
- .unbind(o.events.end, data, o.stop)
- .unbind(o.events.ignored, false);
+ .off(o.events.wheel, o.wheel)
+ .off(o.events.start, o.start)
+ .off(o.events.end, o.stop)
+ .off(o.events.ignored, false);
if (data.thumbs) {
if (data.thumbs.horizontal) {
data.thumbs.horizontal.remove();
@@ -163,7 +163,7 @@
},
triggerEvent: function (event, data) {
- //data.target.trigger('overscroll:' + event);
+ data.target.trigger('overscroll:' + event);
},
// toggles the drag mode of the target
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit bdb793b

Please sign in to comment.