jquery if statement animate back

Posted by user295292 on Stack Overflow See other posts from Stack Overflow or by user295292
Published on 2010-03-21T21:46:50Z Indexed on 2010/03/21 21:51 UTC
Read the original article Hit count: 299

Filed under:
|

how do i add a if statement when the right image is at +400px then animate back to -400px... when hovering the right image?

$('#left img').mouseenter(function() {
  $('#right img').animate({
    left: '+=400px'
  }, 700);                            

});
$('#right img').mouseenter(function() {
  $('#left img').animate({
    left: '-=400px'
  }, 700);

});

something similar to this - http://www.hyundaiusa.com/ (the two main images on the site)

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about animation