Treehouse: Grow your CSS skills. Land your dream job.

Jerky Animation

  • # May 2, 2010 at 5:49 am

    Hi All

    This is my first attempt at using JQuery (thanks Chris for the tutorials that helped).

    Everything that I have done seems to work but sometimes the animated image is very jerky; even when viewing it from local files. Is bad coding or the image size causing it?

    Here is my test page

    Any suggestions/help would be very useful.

    Thanks in advance


    # May 2, 2010 at 9:59 am

    try putting the animation inside:

    $(window).load(function() {

    // your animation


    It might work better after the window has fully loaded everything, otherwise the browser is fighting for resources – and jquery(javascript) is all handled locally…

    # May 3, 2010 at 4:19 am

    Thank you Robskiwarrior for your input. I have tried your suggestion but it hasn’t made any difference. I hope Iadded the window.load in the correct place!

    The updated file (flyby.js) is now on the test site


    # May 3, 2010 at 5:05 am

    You put it in the perfect place.

    I would say then it’s just down to speed of computer. On this PC it’s hardly jerky at all, in FF and Chrome it runs really smooth – this PC is pretty old now (about 4 years) and wasn’t too hot when it was put together… (father inlaws PC lol)

    One of the issues with javascript is that it is very user dependant – as it depends on system resources to load the animation. This is getting less as people’s machines get better and browsers get more efficient at handling JS.

    So for me – it’s running smooth. :) It might just be one of those "things"

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.