Skip to content

Commit

Permalink
Scroll content when mousewheel event is fired over scroll track (mimi…
Browse files Browse the repository at this point in the history
…c default scrollbar behavior)
  • Loading branch information
restlessdesign authored and anutron committed Jun 28, 2011
1 parent f26943f commit 5e44d9b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Layout/MooScroller.js
Expand Up @@ -124,13 +124,19 @@ var MooScroller = new Class({

attach: function(){
this.knob.addEvent('mousedown', this.bound.start);
if (this.options.scrollSteps) this.content.addEvent('mousewheel', this.bound.wheel);
if (this.options.scrollSteps) {
this.content.addEvent('mousewheel', this.bound.wheel);
this.track.addEvent('mousewheel', this.bound.wheel);
}
this.track.addEvent('mouseup', this.bound.page);
},

detach: function(){
this.knob.removeEvent('mousedown', this.bound.start);
if (this.options.scrollSteps) this.content.removeEvent('mousewheel', this.bound.wheel);
if (this.options.scrollSteps) {
this.content.removeEvent('mousewheel', this.bound.wheel);
this.track.removeEvent('mousewheel', this.bound.wheel);
}
this.track.removeEvent('mouseup', this.bound.page);
document.id(document.body).removeEvent('mouseup', this.clearScroll);
},
Expand Down

0 comments on commit 5e44d9b

Please sign in to comment.