Timeout function help needed
Hi all. I am having trouble with the below code:
- $(function() {
var timeoutID = 0;
$('ul#featured_grid li').mouseenter(function() {
timeoutID = setTimeout(function() {
$('.featured_popup', this).animate({ bottom : 0 }, {duration: 'fast'});
}, 400);
}).mouseleave(function() {
$('.featured_popup', this).animate({ bottom : -50 }, {duration: 'fast'});
clearTimeout( timeoutID );
});
});
The code works if I remove 'this', but this makes it display for each li.
I don't have much experience with this level of nesting, so am not sure how to fix this. Can anyone point me in the right direction please?
Thank you