Solved

jquery delay sequence

Posted on 2013-01-12
3
270 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
[X]
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
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use "if not" in a condition 2 19
Jquery HTML() with ajax... replacing content 2 30
Table style position to the left 8 26
Building JSON/JQuery Results Display 11 26
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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)

733 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