[jQuery] Re: setTimeout / clearTimeout question...

2008-01-24 Thread gr00vy0ne
David, Thank you so much for the suggestion. As you expected, it worked perfectly for me. I ended up with the following: function addHoverHide(linkClass, layerId) { var t; $(a. + linkClass).hover(function() { clearTimeout(t); // custom function which creates drop shadows

[jQuery] Re: setTimeout / clearTimeout question...

2008-01-23 Thread David Serduke
How about using closure like this? function addHoverHide(linkClass, layerId) { var t; $(. + linkClass).hover(function() { clearTimeout(t) $(# + layerId).show(); }, function() { t = setTimeout(function() {$(# + layerId).hide()}, 2000); }); } $(document).ready(function () {