Solved

Loop chained effects in jQuery

Posted on 2010-11-11
2
466 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:
jmatix earned 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Angular tyeahead feature not working with Control "as" ControlXXX 4 50
Error Handler 8 42
Jquery syntax 12 29
run powershell script endlessly 3 29
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

734 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