Book Image

jQuery Reference Guide

By : Jonathan Chaffer, Karl Swedberg
Book Image

jQuery Reference Guide

By: Jonathan Chaffer, Karl Swedberg

Overview of this book

<p>jQuery is a powerful, yet easy-to-use JavaScript library that helps web developers and designers add dynamic, interactive elements to their sites, smoothing out browser inconsistencies and greatly reducing development time. In this book, the creators of the popular jQuery learning resource, learningquery.com, share their knowledge, experience, and enthusiasm to bring you a comprehensive reference to the popular JavaScript library.<br /><br />This book offers an organized menu of every jQuery method, function, and selector. Each method and function is introduced with a summary of its syntax and a list of its parameters and return value, followed by a discussion, with examples where applicable, to assist in getting the most out of jQuery and avoiding the pitfalls commonly associated with JavaScript and other client-side languages.<br /><br />If you're already familiar with JavaScript programming, this book will help you dive right into advanced jQuery concepts. You'll be able to experiment on your own, trusting the pages of this book to provide information on the intricacies of the library, where and when you need it. If you're still hungry for more, the book shows you how to cook up your own extensions with jQuery's elegant plug-in architecture.<br /><br />This book is a companion to <a href="http://www.packtpub.com/jQuery/book">Learning jQuery</a>: Better Interaction Design and Web Development with Simple JavaScript Techniques. <br /><a href="http://www.packtpub.com/jQuery/book">Learning jQuery</a> begins with a tutorial to jQuery, followed by an examination of common, real-world client-side problems, and solutions for each of them, making it an invaluable resource for answers to all your jQuery questions.<br /><br />jQuery Reference Guide digs deeper into the library, taking you through the syntax specifications and following up with a detailed discussion. You'll discover the untapped possibilities that jQuery makes available, and hone your skills as you return to this guide time and again.</p>
Table of Contents (19 chapters)
jQuery Reference Guide
Credits
About the Authors
About the Reviewers
Preface
Index

Customized Effects


This section describes how to create effects that are not provided out-of-the-box by jQuery.

.animate()

Note

Performs a custom animation of a set of CSS properties.

.animate(properties[, speed][, easing][, callback])

Parameters
  • properties: A map of CSS properties that the animation will move toward

  • speed (optional): A string or number determining how long the animation will run

  • easing (optional): A string indicating which easing function to use for the transition

  • callback (optional): A function to call once the animation is complete

Return Value

The jQuery object, for chaining purposes.

Description

The .animate() method allows us to create animation effects on any numeric CSS property. The only required parameter is a map of CSS properties. This map is similar to the one that can be sent to the .css() method, except that the range of properties is more restrictive.

All animated properties are treated as a number of pixels. If the property was initially specified in different...