PacktLib: jQuery 2.0 Development Cookbook

jQuery 2.0 Development Cookbook


About the Author

About the Reviewers


Document Object Model Manipulation


Selecting elements

Finding and selecting sibling elements

Creating DOM elements

Inserting content into an element

Modifying the DOM element properties

Adding and removing CSS classes to dynamically change their style

Enabling and disabling buttons by changing their properties

Updating an image within a page

Populating list elements

Understanding pagination

Removing DOM elements

Re-using DOM elements

Interacting with the User by Making Use of jQuery Events


Detecting button clicks

Detecting element clicks

Detecting change

Updating content based on user input

Detecting key press events on inputs

Restricting input character length

Changing page elements on mouse hover

Triggering events manually

Preventing event triggers

Creating a custom event

Loading and Manipulating Dynamic Content with AJAX and JSON


Loading HTML from a web server into a page

Using AJAX and handling server errors

Processing JSON data

Searching JavaScript objects

Sorting JavaScript objects

Caching JSON and AJAX requests

Creating a search feature

Creating an autosuggest feature

Waiting for an AJAX response

Adding Attractive Visuals with jQuery Effects


Sliding page elements

Hiding and showing elements

Fading elements

Toggling effects

Stopping effects

Chaining effects

Creating a basic photo gallery

Creating a blinking button

Removing elements with effects

Form Handling


Implementing basic form validation

Adding number validation

Adding credit card number validation

Adding date validation

Adding e-mail address validation

Implementing live form validation

Adding a password strength indicator

Adding anti-spam measures

Implementing input character restrictions

User Interface


Manipulating element CSS

Creating a news ticker

Creating sticky elements

Implementing smooth scrolling

Creating a dynamic table of contents

Creating a basic drag-and-drop functionality

Creating a dynamic animated tree menu

Creating an accordion content slider

Creating tabbed content

Creating a modal pop up

Creating a draggable content pop up

User Interface Animation


Creating an animated login form

Adding photo zoom

Creating an animated content slider

Animating background images

Creating an animated navigation menu

Understanding Plugin Development


Creating a plugin template

Creating a tooltip plugin

Building a content and image slider plugin

Creating an RSS feed reader plugin

Coding an image cropper plugin from scratch

jQuery UI


Creating stylish and functional buttons

Creating dialog boxes for user information and input

Implementing progress bars within your application

Adding date picker interfaces to input boxes quickly

Creating an autocomplete search feature

Working with jQuery Mobile


Creating a basic mobile website template

Building a complete static website

Building a dynamic mobile website

Implementing the quick call functionality

Implementing the send SMS functionality

Adding mobile-friendly lists

Using touch-oriented events

Creating mobile-compatible forms

Building a complete registration and login system

Building a complete mobile web app