views:

762

answers:

1

I have a page that uses

$(id).show("highlight", {}, 2000);

to highlight an element when I start a ajax request, that might fail so that I want to use something like

$(id).show("highlight", {color: "#FF0000"}, 2000);

in the error handler. The problem is that if the first highlight haven't finished, the second is placed in a queue and wont run until the first is ready. Hence the question: Can I somehow stop the first effect?

+2  A: 

Frome the jQuery docs:

http://docs.jquery.com/Effects/stop

Ryan Lanciaux
Thanks, my google-foo seems to have a dent tonight :-)
Mr Shark
It happens. StackOverflow is good for search outsourcing :)
Ryan Lanciaux