...

View Full Version : Problem getting Function to loop



dylanbaumannn
05-22-2012, 06:32 PM
Hello!

I'm working on a simple jQuery banner-ad for a client and the animations are as follows:

Image fadein
div fadein
div fadeout
Image fadeout



Image2 fadein
div2 fadein
div2 fadeout
Image2 fadeout

Then i need it to loop.


I currently have all the javascript and HTML/CSS to get the animations to display correctly.
However I can't seem to get the darned thing to LOOP correctly! Here is the code I'm currently using:

HTML


<div id="sliderContainer">

<div id="surgCont">
<div class="part1">
<div class="quote1"></div>
</div>
</div><!--/surgCont-->

<div id="careCont">
<div class="part1">
<div class="quote1"></div>
</div>
</div><!--/careCont-->

</div><!--/sliderContainer-->


jQuery


$(function(){
function runIt(){
//Surg
//fadein
$('div#surgCont').animate({opacity: 1}, 1000);
//fadein
$('div#surgCont>.part1>.quote1')
.delay(1000)
//fadeout
$('div#surgCont>.part1>.quote1')
.delay(4500)
.animate({opacity:0},1000);
//fadeout
$('div#surgCont').delay(13000).animate({opacity: 0}, 1000);

//Care
//fadein
$('div#careCont').delay(14000).animate({opacity: 1}, 1000);
//fadein
$('div#careCont>.part1>.quote1')
.delay(15000)
.animate({opacity:1},1000);
//fadeout
$('div#careCont>.part1>.quote1')
.delay(4500)
.animate({opacity:0},1000);
//fadeout
$('div#careCont').delay(13000).animate({opacity: 0}, 1000);
}//runit
runIt();
});


Any help would be greatly appreciated!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum