Re: [jQuery] error when using a timeout

2009-11-12 Thread Andrei Eftimie
>                        hideDelayTimer = setTimeout(function () { >                               $(this).animate({backgroundPosition: '(0 0)'}); >                                hideDelayTimer = null; >                        }, hideDelay); $(this) might not refer to anything in this context. se

[jQuery] error when using a timeout

2009-11-12 Thread matthewordie
I'm using this plugin to animate some background images: http://plugins.jquery.com/project/backgroundPosition-Effect Now it works fine until I wrap the animate function in a timer. Then it gives me errors. I'm changing the image on hover. Here's my code: var hideDelay = 2000; var hideDelayTimer =