homepage Welcome to WebmasterWorld Guest from 54.197.94.241
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
queing jQueryUI effect()
sssweb




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

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?

 

sssweb




msg:4531713
 1:56 pm on Dec 28, 2012 (gmt 0)

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();

});
});

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved