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 6561129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:32:58+00:00 2026-05-25T13:32:58+00:00

I have a sequence with images of an object from different angles. I want

  • 0

I have a sequence with images of an object from different angles. I want the object to be faux rotated when the user drags its mouse, and this I have implemented.

But what I want, is when the mouse leaves the image area, that it animates the image sequence back to the default position.

For instance, I have 30 JPEGs, where 1.jpg is -180° and 30.jpg is 180°. Naturally, 15.jpg is the centered default image at 0°.

So, if the user rotates all the way to (-)180° it will rotate back to 0° after say 3 seconds. But I want the animation to be as smooth as possible. How would I go about to do this?

  • 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-05-25T13:32:58+00:00Added an answer on May 25, 2026 at 1:32 pm

    For the animation to be as smooth as possible, you should use a CSS sprite, an image containing all your other images, so the frames will all be loaded when the animation start.

    Then you only need to call a function in a given amount of time, based on how smooth you want the animation to be, and change the background property of your image. Or, if not using sprite, assign a different src to it.

    I think you should choose a frame-per-second value of no less than 25. Higher frame rate means more smooth animation, but more CPU used.

    This is the basic approach

    function next_frame() {
    
      frame += 1;
    
      // start animation again from the start if last frame reached (optional)
      if ( frame == max_frames ) {
        frame = 0;
      }
    
      /* change either the class of your image (if you use sprites
         and specified a class for each background position) or the
         background position property directly. If not using sprites,
         assign a different image src based on current frame.
      */
    
      // call the function again
      setTimeout( next_frame, 1000 / 25 ); // change 25 with your desired FPS value.
    
    }
    

    If you want the image to animate back, you just need to apply the same approach but with the frame numbers going backwards.

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

Sidebar

Related Questions

I have a task of generating video from a sequence of images in my
I have a set of images ordered in sequence that the user can navigate.
I have a sequence of images taken from a camera. The images consists of
I have read in : this PDF that If I want to track object
I have a sequence of 5 different images each in a separate div. Underneath
I'm using flex and have a few images that I need to sequence through.
Suppose I have a sequence x1,x2,x3.....xn, and I want to find the longest continuous
I have a very high number of small images (360x192), taken in sequence as
I have a set of images that correspond to video thumbnails. The user clicks
I have a sequence of images needed to display in a short time (PNG

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.