$('item').animate({marginLeft:"800px"},500);
//where 500 is the time in ms for the effect to occur in
That's great, but what if you wanted to control how that item got animated towards the end-point in a more generic way.That's where jQuery's Effect functions come into play. By default, jQuery provides us with functions like slideUp and slideDown, fadeIn and fadeOut as well as hide() and show(). You can click on these to see the official documentation on the function, but in short they let you slide items from one position to another, fade in and out or hide or be displayed within a specific amount of time. They're very useful and can be incredibly powerful.
Basic Effects
Fade out and Fade in
Intermediate
Increasing/decreasing the width of an item each time it's clicked
This code expands the width from 400px to 500px
and when done, it expands the height from 20px to 150px
News Headline: This div is about to do something cool.
As you can see we've just revealed some more information that's visible in the original div but not in the css view we've created
Moving an item across the page
News Headline: This div is about to do something cool.
As you can see we've just revealed some more information that's visible in the original div but not in the css view we've created
Moving an item across the page
Advanced
Animating the widths of 3 divs using an interval to update their values over 10 seconds
Section 1Section 2Section 3
A News Headline