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. ...

Get jQuery 2.0 Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.