jQuery EffectsLesson 10Free preview
jQuery Animate
This lesson is part of jQuery · All levels
Summary
The animate() method allows you to animate CSS properties such as position, size, and opacity against new values. You just have to define the property and its value, then the optional duration in milliseconds. Relative values such as "+=50" make the element move a certain distance from its current position.
Key points
- Accept objects containing CSS properties and their target values
- The duration parameter is written in milliseconds, for example 800
- Relative values are written with a prefix plus or minus, e.g. "+=100"
- Callback can be given as the final parameter
- The animated property must have a clear numerical value
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.