Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

jquery delay sequence

Posted on 2013-01-12
3
268 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
ID: 38771705
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
ID: 38772251
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
ID: 38773334
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
forgetful about js objects 8 46
multiple selects 23 48
ASP Classic - JavaScript - Get value from form in iFrame and pass to main page. 2 21
asp Google Map 2 26
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.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

840 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