Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
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
Old 10-29-2012, 04:39 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,699
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Try removing the quotes around “image1” and around the timeout value in the setTimeout function.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 10-29-2012, 04:44 PM   PM User | #3
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
Sorry, but does not work
angelali is offline   Reply With Quote
Old 10-29-2012, 05:13 PM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,699
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
What does the error console say?
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 10-29-2012, 05:16 PM   PM User | #5
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
No error at all... I dont know why it is not working..
angelali is offline   Reply With Quote
Old 10-29-2012, 06:53 PM   PM User | #6
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
well the crap works now... but can you help me in another issue on this animation? thank
angelali is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:12 PM.


Advertisement
Log in to turn off these ads.