Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Loop chained effects in jQuery

Posted on 2010-11-11
2
Medium Priority
?
468 Views
Last Modified: 2012-05-10
Hi.  
I am attempting to create a loop of elements that fade in and out (ie, a slideshow).  I understand how to use the callback function to control the timing of the fades, but how do i loop this?
It feels like a infinite regression.
Thanks,
Chip

$(document).ready(function(){
	$('div#slideshow').children().hide();
	fadeElement('div#slide1', function(){fadeElement('div#slide2');});
});

function fadeElement(elementName, f){   $(elementName).fadeIn(3000).delay(2000).fadeOut(3000, f);
	return;
}

Open in new window

0
Comment
Question by:nbccit
[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
2 Comments
 
LVL 16

Accepted Solution

by:
Justin Mathews earned 2000 total points
ID: 34111962
See this page for a simple fadein slideshow using jQuery:

http://snook.ca/archives/javascript/simplest-jquery-slideshow

0
 

Author Comment

by:nbccit
ID: 34112183
Ahh.  Ok.  I saw something like this as I was looking for a solution.  The design flaw was trying to link the effects, rather than have a parent function call the event.  My unfamiliarity with JS meant I was unaware of the setInterval function.
Sounds like that is the way to go.  Thanks.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

688 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