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

Sliding page elements


The ability to slide page elements allows the developer to create an array of interfaces such as the accordion. This recipe will show you how to apply the slide effect to a range of elements.

Getting ready

Using your favorite text editor or IDE, create a blank HTML page in an easily accessible location and save this file as recipe-1.html. Ensure that you have the latest version of jQuery downloaded at the same location as this HTML file.

How to do it…

Learn how to use jQuery to slide page elements by performing the following steps:

  1. Add the following HTML code to recipe-1.html. Be sure to change the source location of the jQuery library, pointing it to where the latest version of jQuery is downloaded and placed on your computer.

    <!DOCTYPE html>
    <html>
    <head>
      <script src="jquery.min.js"></script>
      <script src="recipe-1.js"></script>
      <title>Chapter 4 :: JQuery Effects</title>
      <link type="text/css" media="screen...