Table of Contents
1 Getting started 7
Introducing jQuery 8
Enabling jQuery 9
Recognizing readiness 10
Avoiding conflict 12
Selecting by tag name 13
Selecting by ID and class 14
Selecting attributes and order 16
Selecting family relatives 18
Selecting multiple elements 20
Filtering visibility 22
Optimizing selections 23
Summary 24
2 Performing actions 25
Traversing elements 26
Moving along 28
Visiting relatives 30
Interrogating selections 32
Applying styles 34
Adding values 36
Toggling classes 38
Calculating sizes 40
Summary 42
3 Managing forms 43
Selecting text fields 44
Selecting by ability 46
Selecting radio buttons 48
Selecting checkboxes 49
Selecting options 50
Selecting buttons 52
Selecting He inputs 54
Recognizing focus 56
Submitting forms 58
Summary 60
4 Manipulating elements 61
Changing content 62
Changing attributes 64
Adding content 66
Wrapping elements 68
Replacing elements 70
Removing elements 72
Attaching data 74
Storing data 76
Summary 78
5 Recognizing events 79
Detecting clicks 80
Feeling pressure 82
Detecting presence 84
Guarding borders 86
Spotting movement 88
Detecting keys 90
Adjusting size 92
Scrolling around 94
Summary 96
6 Attaching handlers 97
Binding to an event 98
Binding multiple handlers 100
Passing event data 102
Triggering handlers 104
Removing handlers 106
Registering callbacks 108
Deferring callbacks 110
Keeping promises 112
Summary 114
7 Producing effects 115
Hiding elements 116
Toggling elements 118
Sliding elements 120
Fading content 122
Fading to levels 124
Animating elements 126
Stopping animations 128
Handling queues 130
Summary 132
8 Employing Ajax 133
Loading content 134
Loading spans 136
Testing loads 138
Getting response 140
Performing requests 142
Serializing form data 144
Handling failure 146
Setting global handlers 148
Summary 150
9 Using plugins 151
Grabbing plugins 152
Writing plugins 154
Enabling chains 156
Protecting the alias 158
Passing parameters 160
Visiting each element 162
Providing options 164
Plugging-in dialogs 166
Summary 168
10 Handy reference 169
Basic and Hierarchy selectors 170
Attribute selectors 171
Filler selectors 172
Content and Form selectors 173
Core and Callbacks 174
CSS 175
AJAX 176
Deferred 177
Effects 178
Events 179
Manipulation 182
Traversing tree 184
Traversing filtering 185
Data 185
Utilities 186
Index 187