Created
July 4, 2018 08:44
-
-
Save kieran23101/faaff74dc790cbc4872dec7cc567ebe5 to your computer and use it in GitHub Desktop.
Fixes the scroll lag on IE
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
if (navigator.userAgent.match(/Trident\/7\./)) { | |
// if IE | |
$("body").on("mousewheel", function() { | |
// remove default behavior | |
event.preventDefault(); | |
//scroll without smoothing | |
var wheelDelta = event.wheelDelta; | |
var currentScrollPosition = window.pageYOffset; | |
window.scrollTo(0, currentScrollPosition - wheelDelta); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment