content top
jQuery Animation Tutorialized

jQuery Animation Tutorialized

 

This week I’m going to show you to make the best use of jQuery’s amazing animation features using just a few lines of code for each our examples. Did you know that you can use jQuery’s animation functions to create your very own progress-bar in less than 3 lines? or that you could use it to make your very own accordian in under 9 lines? Well, today I’m going to go through some examples of how to do these and a whole lot more.

 

First let’s start with some basics. What is the jQuery animate() feature?. The animate() feature allows you to create custom animations using a few lines of code – it’s key aspect is the object containing all of the style properties to be animated and to what end. Essentially this means that it allows you to specify what you want to animate and where you eventually want that item to appear. For example, if I have a div called "red" on what side of the screen, I can specify the end of the screen as an end-point and have it animate towards that point. I’m able to also say what property of the item I would like animated -eg. in the above case if I wanted to move the item towards the end of the screen..I would alter the marginLeft property from where it is right now to something larger. This is done as follows:

Bookmark and Share
Share

Related posts:

  1. 12 new examples of Advanced Animation techniques with jQuery When you think about animation on the internet, chances are...
  2. How to create impressive animations in jQuery with .animate() I’ve been asked many times over the past month...
  3. How to enlarge images with jQuery Guest writer,  Jeffrey Jordan Way. I’ve created many tutorials...
  4. jQuery UI Animation Effects The jQuery UI Effects Core brings a few more...
  5. The Best Advanced Animation techniques you can perform using jQuery When you think about animation on the internet, chances are...

Related posts brought to you by Yet Another Related Posts Plugin.

9 Comments »

  1. avatar
    sammysunset Says:
    October 29th, 2009 at 5:39 pm
    comment-top

    Again, great article, Addy!

    For some reason, your code snippets are showing line breaks with an extra graphic (green, swooshy arrow). It might confuse people.

    Just my two cents! Thanks for another helpful article!

    comment-bottom
  2. avatar comment-top

    I found your article through dzone – nice. I'll give you an "up" vote on there, but wanted to comment here as well. Great Job…

    comment-bottom
  3. avatar comment-top

    Thanks! I looked into it and its because the lines are wrapping around due to my layout's width. I'll see if I can hack together a patch for the highlighter.

    Appreciate the heads up :)

    comment-bottom
  4. avatar comment-top

    Thanks! I'm glad you enjoyed the article.

    comment-bottom
  5. avatar comment-top

    Thanks for good tips.

    comment-bottom
  6. avatar comment-top

    WOW! I was looking for a compact slideshow and ran across your site which really opened my eyes to the possibilities of JQuery. Great work. Thanks.

    comment-bottom
  7. avatar comment-top

    My pleasure!. Thanks for reading.

    comment-bottom
  8. avatar comment-top

    You're very welcome. I'm happy to see that my articles are helping other coders see how useful jQuery can be!

    comment-bottom
  9. avatar comment-top

    Hi, I’m a newbie. I’m still learning hence I don’t have my website yet. Hopefully, I can create one soon with the JQuery you taught.

    I’d like to know why when I click on your animation button of your exampes above, nothing happens. I have java turn on in my browser.

    Please advise. tk.s

    comment-bottom

RSS feed for comments on this post. TrackBack URL

Leave a comment