So I am trying to make a hover effect on a product grid, to show more info etc. I want to add some delay when the user is not hovering the grid element anymore, but I have tried but with no luck:
$('.product-grid > .panel').hover(function() {
$(this).addClass('active');
}, function() {
setTimeout(function(){
$(this).removeClass('active');
}, 2000);
});
Here is a fiddle of my problem: fiddle
I suppose you have wrong context of function You need to use something like
Fiddle