Book Image

jQuery 2.0 Development Cookbook

By : Leon Revill
Book Image

jQuery 2.0 Development Cookbook

By: Leon Revill

Overview of this book

Table of Contents (17 chapters)
jQuery 2.0 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Removing elements with effects


You will often create interfaces such as lists or tables that will be representing data from a database. If the interface is for management purposes, you will typically be able to add, edit, and remove these items. We can use jQuery effects to add to the user experience when these items are added, as described in the Fading elements recipe. We can also provide effects when removing an item from the DOM. Thanks to jQuery, it is very easy to do.

Getting ready

As with the other recipes in this chapter, you are going to need a blank HTML document. Save this document as recipe-9.html and ensure it is within the same directory as the latest version of jQuery.

How to do it…

Understand how you can remove DOM elements with effects by performing the following steps:

  1. Add the following HTML code to the HTML document you have just created:

    <!DOCTYPE html>
    <html>
    <head>
      <script src="jquery.min.js"></script>
      <script src="recipe-9.js">&lt...