Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9141713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:40:54+00:00 2026-06-17T09:40:54+00:00

I’m looking to adapt this really simple and effective jQuery script: jQuery to animate

  • 0

I’m looking to adapt this really simple and effective jQuery script:
jQuery to animate image from left to right? (thanks DonamiteIsTnt)…

I would like to know how to expand upon it so you could effectively use two images with a “switch” animation. For example, a bird flies to the right of the screen – flip animation – bird appears to fly back to the left – flip animation – flies to the right again.

The “switch” animation I was thinking something along the lines of a 2D image effectively turning upon itself (like a goldfish swimming back and forth in a bowl and how it would appear to us from the front of the glass).

I don’t know if you would use a single image in this case and shrink it from 30px wide to 0px then -30px, etc. to face it the other way. Or need to switch between a right-facing image and a left-facing image. Either way, it would be cool to have it animated.

I have found similar questions on this site referring to the left and right effect and the flip effect, but not combined. So any help would be greatly appreciated!

As a side note: I have linked to http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js

Edit: Have got this far…

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">

    $(document).ready(function() {

function beeRight() {
    $("#b").animate({left: "+=300"}, 5000, "swing", beeLeft);
    $("#img").attr("src","rightArrow.gif");
}
function beeLeft() {
    $("#b").animate({left: "-=300"}, 5000, "swing", beeRight);
    $("#img").attr("src","leftArrow.gif");
}
beeRight();
    });
    </script>
    </head>

    <body>
<div id="b" style="position:absolute;"><img id="img" src="rightArrow.gif"></div>
    </body>

How would I then add an animated image swap such as: http://davidwalsh.name/demo/css-flip.php – needless to say, does not need to be as complicated. I’m looking to do this with img’s, not div’s. I understand how something like this would be done in CSS but I do not know how to incorporate it with the jQuery/Javascript.

Thanks again!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:40:55+00:00Added an answer on June 17, 2026 at 9:40 am

    Depending on the browsers you’re targeting, you could achieve the effect entirely in CSS3. Use a couple of classes to represent the beginning and ending states and some translatex transforms and scalex transforms to handle the flipping. Then add CSS transition property to animate. Then you can use whatever you like to trigger the class change, :hover, jQuery timer, element click, whatever.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.