Created
June 14, 2018 08:42
-
-
Save smartdeal/24a01d967007a2b3e465a52081ee9227 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); | |
}); | |
/* css | |
.disable-hover, | |
.disable-hover * { | |
pointer-events: none !important; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment