Skip to content

Instantly share code, notes, and snippets.

@smartdeal
Created June 14, 2018 08:42
Show Gist options
  • Save smartdeal/24a01d967007a2b3e465a52081ee9227 to your computer and use it in GitHub Desktop.
Save smartdeal/24a01d967007a2b3e465a52081ee9227 to your computer and use it in GitHub Desktop.
[Отключение ховера при прокрутке] #jQuery
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