Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
jQuery 1.4 Animation Techniques: Beginners Guide

You're reading from  jQuery 1.4 Animation Techniques: Beginners Guide

Product type Book
Published in Mar 2011
Publisher Packt
ISBN-13 9781849513302
Pages 344 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (19) Chapters

jQuery 1.4 Animation Techniques Beginner's Guide
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introduction 2. Fading Animations 3. Managing Animations 4. Sliding Animations 5. Custom Animations 6. Extended Animations with jQuery UI 7. Full Page Animations 8. Other Popular Animations 9. CSS3 Animations 10. Canvas Animations Pop Quiz Answers Index

Fading elements out


The fadeOut() method is syntactically identical to fadeIn() in that it accepts the same arguments and adjusts the opacity of the selected element, except that with the fadeout() method, the target element is hidden instead of being shown. Let's look at this method in action with a brief example.

When elements need to be removed from the page, using a subtle fade out can be much more effective than just removing the element in question. We may have an overlay of some description, like a dialog box for example, on the page which can be closed by the visitor. Instead of having it disappear instantly, we can animate its disappearance smoothly.

In this example, we'll look at the following aspects of using fadeOut():

  • Hiding an element with the fadeOut() method

  • Using a numerical argument to control the duration

  • Running additional code once the animation completes

This is how our dialog will disappear from the page:

In the previous screenshot, we see the dialog gradually fading from...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}