JS will not loop, stops after first loop
I've written the code below to act as a simple slideshow in the header of
a clients website. Now, the only problem is when I put it into a for or a
while loop it gets to the end of the first loop and then stops.
I've tried using calling togglinga() in the last callback, I've tried,
wrapping the whole thing in a for and while loop, I've tried creating a
different function that calls this one and then using that same function
name in the final call back but get the same result everytime. I'd really
appreciate someone casting their eye over this to see if they can see
anything I can't....
Thanks
function togglinga(){ triggerAnimation };
function triggerAnimation(){
$("#logoareacontainer").delay(15000).fadeOut(3000, function() {
$("#title-1").fadeIn(0).delay(0, function() {
$("#cdsl-1-1").fadeIn(1000).delay(2000).fadeOut(0,
function(){
$("#cdsl-1-2").fadeIn(0).delay(2000).fadeOut(0,
function(){
$("#cdsl-1-3").fadeIn(0).delay(2000).fadeOut(0,
function(){
$("#cdsl-1-4").fadeIn(0).delay(2000).fadeOut(0,
function(){
$("#title-1").fadeOut(0).css({display:'none'})
$("#title-2").fadeIn(0).delay(0, function() {
$("#cdsl-2-1").fadeIn(0).delay(2000).fadeOut(0,
function(){
$("#cdsl-2-2").fadeIn(0).delay(2000).fadeOut(1000,
function(){
$("#title-2").fadeOut(1000).css({display:'none'})
$("#title-3").fadeIn(0).delay(2000,
function() {
$("#cdsl-3-1").fadeIn(1000).delay(2000).fadeOut(1000,
function(){
$("#cdsl-3-2").fadeIn(1000).delay(2000).fadeOut(1000,
function(){
$("#title-3").fadeOut(1000).css({display:'none'})
$("#title-4").fadeIn(0).delay(0,
function() {
$("#title-4-1").fadeIn(1);
$("#cdsl-4-1").fadeIn(1000).delay(2000).fadeOut(1000,
function(){
$("#cdsl-4-2").fadeIn(1000).delay(2000).fadeOut(1000,
function(){
$("#title-4").fadeOut(1000).css({display:'none'})
$("#title-4-1").fadeOut(1000).css({display:'none'})
$("#title-5").fadeIn(0).delay(0,
function()
{
$("#title-5-1").fadeIn(1);
$("#cdsl-5-1").fadeIn(1000).delay(2000).fadeOut(1000,
function(){
$("#title-5").fadeOut(1000).css({display:'none'})
$("#title-5-1").fadeOut(100).css({display:'none'})
$("#title-6").fadeIn(0).delay(0,
function()
{
$("#cdsl-6-1").fadeIn(1000).delay(2000).fadeOut(1000,
function(){
$("#title-6").fadeOut(1000).css({display:'none'})
$("#logoareacontainer").fadeIn(1000).css({display:'block'})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
}
No comments:
Post a Comment