I want to remove the glitch
class after one second. I tried to solve it with setTimeout
but it didn't work. The class wasn't removed on mouseleave.
$(document).ready(function (e) {
$('.glident').hover(function() {
$(this).addClass('glitch')
}, function() {
$(this).removeClass('glitch')
})
});
Thats what I tried to do:
$(document).ready(function () {
$('.glident').mouseover(
function () {
$(this).addClass('glitch')
}
);
$('.glident').mouseout(
setTimeout(function () {
$(this).removeClass('glitch');
}, 1000)
);
});