View Single Post
Old 10-29-2012, 04:32 PM   PM User | #1
angelali
Regular Coder

 
Join Date: Sep 2011
Posts: 310
Thanks: 23
Thanked 0 Times in 0 Posts
angelali is an unknown quantity at this point
JQuery image animation

Ok, I was doing a simple JQuery animation. An image will move to the left by 1000px, once it stops, it will be replaced to another image. The code below:

Code:
function image1() {
    $('#photo').animate({left: '1000px'}, 40000, function() {
        $('#photo').attr('src', 'image2.jpg');
       setTimeout("image1", "2000")
    });
}

The issue, it does not work. How to tackle it?

Thank!
angelali is offline   Reply With Quote