Solved

jquery delay sequence

Posted on 2013-01-12
3
263 Views
Last Modified: 2013-01-13
Hello Experts,

I hope someone can help me.
For some reason the delay in not working. i am trying to increase delay on each div.

var delay = 50;

$('#valeri-logo div').each(function (i) {
		 
			$(this).animate({right:0}, 100, "easeInOutBack", function() {
			$(this).delay(delay).animate({left:-100}, 1800, "easeInOutBack").fadeOut(1500);
				i * (delay * 1500);
		});

Open in new window

0
Comment
Question by:Refael
3 Comments
 
LVL 11

Accepted Solution

by:
mcnute earned 500 total points
Comment Utility
if you're trying to increase the delay then you should do something like this:

var delay = 50;
var i =  0;

$('#valeri-logo div').each(function () {
		 
			$(this).animate({right:0}, 100, "easeInOutBack", function() {
			$(this).delay(delay).animate({left:-100}, 1800, "easeInOutBack").fadeOut(1500);
                                 i++;
				delay = (i* 1500);
		});

Open in new window


That will increase your delay by the result of multiplying i with 1500, with i increasing by one on each iteration in the each loop.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
I'm not clear. Are you just trying to increase the delay, or what mcnute is suggesting and increasing it more with each iteration?

Cd&
0
 

Author Comment

by:Refael
Comment Utility
mcnute, thank you.
COBOLdinosaur , yes i just wanted to delay in sequence... first end then second begin.
mcnute solution is right to the point :-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now