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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:08:13+00:00 2026-06-13T23:08:13+00:00

I am using Spritely to animate sprites. I have managed to pan successfully however

  • 0

I am using Spritely to animate sprites. I have managed to pan successfully however my final job is to create ‘stars’ that fade in and out. I have created a sprite sheet:

sprites

I followed the documentation found here and altered the number of frames and the frames per second.

$('#star').sprite({fps: 24, no_of_frames: 12});

My issue is that the sprite’s animation is both jerky and doesn’t seem to follow the sprite image, which should fade in and then out. Presently it jerks between semi visible and fully.

I used Chrome’s console to log the frames and I only seem to get frames 0,1 and 2. I would have expected 12 frames (one per image in the sprite) but I am new to this so I might be mistaken. It doesn’t seem to reach the last frame either according to the logs.

enter image description here

Here is my code in full:

(function($) {
        $(document).ready(function() {           
           $('.purplestar').sprite({
                fps: 24, 
                no_of_frames: 12,
                start_at_frame: 0,
                        on_first_frame: function(obj) {
                            if (window.console) {
                                console.log('first frame');
                            }
                        },
                        on_last_frame: function(obj) {
                            if (window.console) {
                                console.log('last frame');
                            }
                        },
                        on_frame: {
                            2: function(obj) {
                                if (window.console) {
                                    console.log('frame 2');
                                }
                            },
                            1: function(obj) {
                                if (window.console) {
                                    console.log('frame 1');
                                }
                            },
                            0: function(obj) {
                                if (window.console) {
                                    console.log('frame 0');
                                }
                            },
                            3: function(obj) {
                                if (window.console) {
                                    console.log('frame 3');
                                }
                            }
                        }
            });

           $('#balloonleft').pan({fps: 30, speed: 4, dir: 'up', depth: 70});
           $('#balloonright').pan({fps: 30, speed: 3, dir: 'up', depth: 70});
           $('#bird')
                    .sprite({
                        fps: 9, 
                        no_of_frames: 3,
                        // the following are optional: new in version 0.6...
                        start_at_frame: 2
                    })
                    .spRandom({top: 50, bottom: 200, left: 300, right: 320})
                    .activeOnClick()
                    .active();

    });
    })(jQuery);
  • 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-13T23:08:14+00:00Added an answer on June 13, 2026 at 11:08 pm

    First of all thanks to Rohaq for his answer, which does provide an alternative method however it doesn’t answer my question directly, which I managed to figure out.

    Spritely effectively changes the background-position property on a div. I found my issue was cause by having a sprite of a width that when divided by the number of frames did not produce an integer. When I changed the width of my sprite so that the width was 1200px and at 12 frames this meant each frame was 100px. Before I had 57.5px, which didn’t work.

    The jerky nature was my own doing as one of the frames had the sprite 1px to the left than the others.

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

Sidebar

Related Questions

I have two ArrayList's that I am using, one for the enemy sprites and
I am working on an animated jQuery menu using Spritely the problem I have
Using SSRS 2008 R2 I have a background process that dynamically generates RDL for
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
OK, so I have these background <div> s which pan left and right using
Using CRM 4, I have an entity form that contains a tab with an
I am currently creating an animation in jQuery using Spritely. How would i go
Using MVC2 I have an AJAX form which is posting to a bound model.
Using Core Data, I have a fetch request to fetch the minimum of a
Using SolrNet for querying & faceting. I have a combination of int, tdate and

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.