Created
July 31, 2015 06:31
-
-
Save redhedded1/6754c79e59f307fe6d80 to your computer and use it in GitHub Desktop.
overscroll fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> // Init Overscroll for Sports By Year and Hall of Fame Members | |
jQuery(document).ready(function($) { | |
$(function(o){ | |
o = $("#overscroll-year-wrapper ul").overscroll({ | |
cancelOn: '.no-drag', | |
direction: 'horizontal', | |
captureThreshold: 3, // The number of mouse move events before considering the gesture a "drag" | |
driftDecay: 1.1, // The linear-friction coefficient for drift decay (must be > 1) | |
driftSequences: 120, // The number of animation frames to constrain a drift to | |
driftTimeout: 500 // The amount of time to imply the user is no longer trying to drift (in ms) | |
}).on('overscroll:driftstart', function(event){ | |
console.log(event.type); | |
// $('a').click(function(event){ | |
$(window).on('click', function(event){ | |
event.preventDefault(); // Remove default click event if driftstart detected | |
}); | |
}).on('overscroll:driftend', function(event){ | |
console.log(event.type); | |
// $('a').unbind('click'); // Enable default click event if driftend detected | |
$(window).off('click'); // Enable default click event if driftend detected | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment