Created
June 14, 2018 08:40
-
-
Save smartdeal/2d385cc69cb1c007e0b2f21613bf9d9d to your computer and use it in GitHub Desktop.
[Отключение ховера при прокрутке] #jQuery
This file contains hidden or 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
var timer, // быстрая прокрутка, отключение ховера при прокрутке | |
classname = 'disable-hover', | |
$body = $('body'); | |
$(window).scroll(function() { | |
clearTimeout(timer); | |
if (!$body.hasClass(classname)) { | |
$body.addClass(classname); | |
} | |
timer = setTimeout(function(){ | |
$body.removeClass(classname); | |
},500); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment