4

I cannot get the following callback function to work. The alert is never triggered. The initial animation is performed on '.carousel-images' however.

$('.carousel-images').animate({'left' : left_indent},{queue:false, duration:500},function(){
    alert("animate carousel");

    //get the first list item and put it after the last list item   
    $('.carousel-images li:last').after($('.carousel-images li:first'));  

    //get the left indent to the default  
    $('.carousel-images').css({'left' : '-1200px'});  
});

Any assistance would be greatly appreciated!

2 Answers 2

1

Since you are using the second method the complete callback has to be passes as a property to the options object

You need to use

$('.carousel-images').animate({'left' : left_indent},{queue:false, duration:500, complete: function(){
    alert("animate carousel");

    //get the first list item and put it after the last list item   
    $('.carousel-images li:last').after($('.carousel-images li:first'));  

    //get the left indent to the default  
    $('.carousel-images').css({'left' : '-1200px'});  
}});
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I was referring to old documentation
0

your syntex is wrong, it should be

$('.carousel-images').animate({'left' : left_indent},{queue:false, duration:500, complete: function () {
                ...
            }
        });

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.