Acknowledgments |
|
xv | |
Introduction |
|
xvii | |
|
1 Getting Started with jQuery |
|
|
1 | (18) |
|
|
2 | (5) |
|
Basic HTML and CSS Knowledge |
|
|
2 | (1) |
|
Basic Text Editor and Web Browser Knowledge |
|
|
3 | (1) |
|
Basic JavaScript Knowledge |
|
|
4 | (3) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
9 | (2) |
|
|
9 | (1) |
|
|
10 | (1) |
|
Local or CDN: Which Method Should I Use? |
|
|
11 | (1) |
|
|
11 | (3) |
|
Locating the Proper Element |
|
|
12 | (1) |
|
Waiting for the Document to Be Ready |
|
|
13 | (1) |
|
Try This 1-1 Add Another Class |
|
|
14 | (1) |
|
|
15 | (1) |
|
|
15 | (4) |
|
2 Selecting Elements in the Document |
|
|
19 | (30) |
|
|
20 | (1) |
|
|
20 | (4) |
|
|
22 | (1) |
|
Selecting Elements Using IDs and Classes |
|
|
22 | (2) |
|
|
24 | (13) |
|
The All, Element, Class, and ID Selectors |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
29 | (1) |
|
The First Child, Last Child, and Nth Child Selectors |
|
|
30 | (2) |
|
|
32 | (1) |
|
|
33 | (3) |
|
The Remaining CSS Selectors |
|
|
36 | (1) |
|
Try This 2-1 Add Another Class |
|
|
37 | (1) |
|
Using Extended jQuery Selectors |
|
|
38 | (6) |
|
The Attribute Not Equal Selector |
|
|
39 | (2) |
|
The First, Last, and Element at Index Selectors |
|
|
41 | (2) |
|
The Even and Odd Selectors |
|
|
43 | (1) |
|
Try This 2-2 More Selection Practice |
|
|
44 | (2) |
|
|
46 | (3) |
|
|
49 | (28) |
|
Waiting for the Document to Be Ready |
|
|
50 | (2) |
|
|
50 | (1) |
|
|
51 | (1) |
|
Using the Argument with ready() |
|
|
51 | (1) |
|
|
52 | (6) |
|
|
53 | (5) |
|
|
58 | (11) |
|
|
58 | (3) |
|
|
61 | (1) |
|
|
62 | (1) |
|
Event Capturing and Bubbling |
|
|
62 | (3) |
|
Using the on() Method to Handle Events |
|
|
65 | (3) |
|
|
68 | (1) |
|
Try This 3-1 Add Event Handlers |
|
|
69 | (2) |
|
|
71 | (2) |
|
Try This 3-2 Trigger Practice |
|
|
73 | (1) |
|
|
74 | (3) |
|
|
77 | (28) |
|
|
78 | (1) |
|
|
78 | (7) |
|
|
79 | (1) |
|
|
80 | (5) |
|
|
85 | (8) |
|
The addClass() and removeClass() Methods |
|
|
85 | (2) |
|
|
87 | (5) |
|
|
92 | (1) |
|
Try This 4-1 Use toggleClass() |
|
|
93 | (2) |
|
Size and Position Methods |
|
|
95 | (5) |
|
The width() and height() Methods |
|
|
95 | (1) |
|
The innerWidth() and innerHeight() Methods |
|
|
95 | (1) |
|
The outerWidth() and outerHeight() Methods |
|
|
96 | (1) |
|
|
96 | (1) |
|
|
97 | (1) |
|
The scrollLeft() and scrollTop() Methods |
|
|
98 | (2) |
|
Try This 4-2 Use offset() |
|
|
100 | (1) |
|
|
101 | (4) |
|
5 JavaScript and the Document Object Model |
|
|
105 | (34) |
|
|
106 | (15) |
|
|
106 | (1) |
|
|
107 | (3) |
|
|
110 | (5) |
|
|
115 | (1) |
|
|
116 | (2) |
|
|
118 | (1) |
|
|
119 | (2) |
|
Try This 5-1 Use JavaScript with jQuery |
|
|
121 | (2) |
|
The Document Object Model (DOM) |
|
|
123 | (1) |
|
|
123 | (12) |
|
|
123 | (4) |
|
|
127 | (5) |
|
|
132 | (2) |
|
|
134 | (1) |
|
Try This 5-2 Add Elements |
|
|
135 | (1) |
|
|
136 | (3) |
|
|
139 | (36) |
|
Show and Hide Animation Methods |
|
|
140 | (16) |
|
The show() and hide() Methods |
|
|
141 | (7) |
|
The slideDown() and slideUp() Methods |
|
|
148 | (4) |
|
The fadeln() and fadeOut() Methods |
|
|
152 | (4) |
|
|
156 | (5) |
|
Try This 6-1 Practice with slideDown() |
|
|
161 | (1) |
|
Creating Custom Animations |
|
|
162 | (6) |
|
|
163 | (1) |
|
|
163 | (1) |
|
|
163 | (1) |
|
|
164 | (1) |
|
The Second Form of animate() |
|
|
164 | (1) |
|
|
165 | (3) |
|
Try This 6-2 Chain on a Custom Animation |
|
|
168 | (1) |
|
|
169 | (3) |
|
|
172 | (3) |
|
|
175 | (26) |
|
The Event Object in jQuery |
|
|
176 | (4) |
|
|
176 | (1) |
|
|
177 | (3) |
|
|
177 | |
|
|
180 | (3) |
|
|
183 | (4) |
|
|
187 | (3) |
|
Try This 7-1 Practice Using which |
|
|
190 | (2) |
|
|
192 | (5) |
|
The stopPropagation() Method |
|
|
192 | (2) |
|
The stopImmediatePropagation() Method |
|
|
194 | (2) |
|
|
196 | (1) |
|
Try This 7-2 Practice Stopping Propagation |
|
|
197 | (1) |
|
|
198 | (3) |
|
|
201 | (38) |
|
|
202 | (4) |
|
|
202 | (4) |
|
|
206 | (8) |
|
The blur() and focus() Methods |
|
|
206 | (4) |
|
|
210 | (3) |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
214 | (4) |
|
Creating Regular Expressions |
|
|
215 | (1) |
|
Testing Strings Against Regular Expressions |
|
|
215 | (2) |
|
|
217 | (1) |
|
Try This 8-1 Practice Using Regular Expressions |
|
|
218 | (1) |
|
|
219 | (14) |
|
|
220 | (3) |
|
|
223 | (5) |
|
|
228 | (5) |
|
Try This 8-2 Practice Validation |
|
|
233 | (2) |
|
|
235 | (4) |
|
|
239 | (38) |
|
|
240 | (1) |
|
|
240 | (14) |
|
|
241 | (7) |
|
|
248 | (3) |
|
|
251 | (3) |
|
Try This 9-1 Practice Basic AJAX |
|
|
254 | (2) |
|
|
256 | (15) |
|
Using Get and Post Requests |
|
|
256 | (10) |
|
|
266 | (2) |
|
|
268 | (3) |
|
Try This 9-2 Practice Serialization |
|
|
271 | (1) |
|
Security Issues and Further Information |
|
|
272 | (2) |
|
|
273 | (1) |
|
|
274 | (3) |
|
|
277 | (20) |
|
Introduction to jQuery Plugins |
|
|
278 | (1) |
|
|
278 | (6) |
|
Downloading and Installing a Plugin |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
281 | (3) |
|
Try This 10-1 Practice Using a Plugin |
|
|
284 | (2) |
|
|
286 | (5) |
|
|
286 | (4) |
|
|
290 | (1) |
|
|
291 | (1) |
|
|
291 | (1) |
|
|
291 | (1) |
|
Try This 10-2 Practice with jQuery UI |
|
|
291 | (2) |
|
|
293 | (4) |
|
|
297 | (26) |
|
Global Methods and the Alias |
|
|
298 | (8) |
|
|
298 | (1) |
|
Creating Methods and Minimizing Naming Conflicts |
|
|
299 | (7) |
|
Creating jQuery Object Methods |
|
|
306 | (8) |
|
Extending the jQuery Object |
|
|
306 | (3) |
|
Using Implicit Iteration and Returning a jQuery Object |
|
|
309 | (2) |
|
User Customization with an Options Map |
|
|
311 | (3) |
|
Try This 11-1 Practice Plugin Options |
|
|
314 | (2) |
|
Adding a Callback Function |
|
|
316 | (2) |
|
Try This 11-2 Practice with Callbacks |
|
|
318 | (2) |
|
|
320 | (3) |
|
12 Advanced Techniques and Further Resources |
|
|
323 | (14) |
|
|
324 | (8) |
|
|
324 | (2) |
|
|
326 | (2) |
|
|
328 | (4) |
|
Try This 12-1 Practice Using a Lint Tool |
|
|
332 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
334 | (1) |
|
|
334 | (3) |
|
|
337 | (8) |
|
Chapter 1 Getting Started with jQuery |
|
|
338 | (1) |
|
Chapter 2 Selecting Elements in the Document |
|
|
338 | (1) |
|
|
339 | (1) |
|
Chapter 4 Working with Styles |
|
|
339 | (1) |
|
Chapter 5 JavaScript and the Document Object Model |
|
|
340 | (1) |
|
Chapter 6 Animations and Effects |
|
|
340 | (1) |
|
Chapter 7 The Event Object |
|
|
341 | (1) |
|
Chapter 8 The DOM and Forms |
|
|
342 | (1) |
|
Chapter 9 Working with AJAX |
|
|
342 | (1) |
|
|
343 | (1) |
|
Chapter 11 Creating Plugins |
|
|
343 | (1) |
|
Chapter 12 Advanced Techniques and Further Resources |
|
|
344 | (1) |
Index |
|
345 | |