CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   JQuery image animation (http://www.codingforums.com/showthread.php?t=280007)

angelali 10-29-2012 04:32 PM

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!

VIPStephan 10-29-2012 04:39 PM

Try removing the quotes around “image1” and around the timeout value in the setTimeout function.

angelali 10-29-2012 04:44 PM

Sorry, but does not work :(

VIPStephan 10-29-2012 05:13 PM

What does the error console say?

angelali 10-29-2012 05:16 PM

No error at all... I dont know why it is not working..

angelali 10-29-2012 06:53 PM

well the crap works now... but can you help me in another issue on this animation? thank


All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.