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

Pre-Packaged Effects


These methods allow us to quickly apply commonly used effects with a minimum configuration.

.show()

Note

Displays the matched elements.

.show([speed][, callback])

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

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

Return Value

The jQuery object, for chaining purposes.

Description

With no parameters, the .show() method is the simplest way to display an element:

$('.target').show();

The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling .css('display', 'block'), except that the display property is restored to whatever it was initially. If an element is given a display value of inline, then it is hidden and shown, it will once again be displayed inline.

When a speed is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously...