Welcome to WebmasterWorld Guest from 54.163.168.15

Forum Moderators: open

queing jQueryUI effect()

   
6:44 pm on Dec 27, 2012 (gmt 0)

5+ Year Member



I have a jQueryUI effect() animation that I want to repeat several times with a delay between each. When I simply chain them:

$("#id").effect("highlight").delay(1000).effect("highlight");

there's no delay between them (not sure why).

So I'm trying to use .queue() but it's new to me and I can't get the code right. What's the easiest way to do this?
1:56 pm on Dec 28, 2012 (gmt 0)

5+ Year Member



Okay -- I worked this out through trial & error, though I can't say I fully understand how it works; this is for 3 repetitions:

$("#id).effect("highlight");

$("#id").queue( function() {

$(this).delay(1000).effect("highlight").dequeue();

$("#id").queue( function() {
$(this).delay(1000).effect("highlight").dequeue();

});
});
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month