Skip to content

Commit

Permalink
Added capability to scroll during slide transition
Browse files Browse the repository at this point in the history
  • Loading branch information
roganartu committed Oct 29, 2014
1 parent 4c09fe3 commit f29b359
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $(document).ready( function() {
beforeSlide : function(){},
endSlide : function(){},
mouseWheelEvents : true,
mouseWheelDelay : 250,
mouseDragEvents : true,
touchEvents : true,
arrowKeyEvents : true,
Expand Down
12 changes: 11 additions & 1 deletion fsvs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
beforeSlide : function(){},
endSlide : function(){},
mouseWheelEvents : true,
mouseWheelDelay : 250,
mouseDragEvents : true,
touchEvents : true,
arrowKeyEvents : true,
Expand Down Expand Up @@ -82,6 +83,14 @@

var mouseWheelTimer = false;

/**
* [mouseWheelScrollStart description]
* Indicates when the mouseWheel last invoked a slide event.
* @type {Integer}
*/

var mouseWheelScrollStart = 0;

/**
* [pagination description]
* @type {Boolean}
Expand Down Expand Up @@ -221,7 +230,8 @@
// chrome seems to extends its "wheely" motion
wheely = Math.floor( wheely / 5 );
}
if( ! scrolling && Math.abs( wheely ) > 5 ) {
if( ( ! scrolling || Date.now() > mouseWheelScrollStart + options.mouseWheelDelay ) && Math.abs( wheely ) > 5 ) {
mouseWheelScrollStart = Date.now();
scrolling = true;
// Firefox goes backwards... obviously
if( e.originalEvent && e.originalEvent.detail ) {
Expand Down

0 comments on commit f29b359

Please sign in to comment.