forked from tuupola/jquery_dictionary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdictionary.xml
More file actions
12385 lines (12056 loc) · 420 KB
/
dictionary.xml
File metadata and controls
12385 lines (12056 loc) · 420 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!-- This file is generated from api-1.3.xml using XSLT and dictionary.xsl -->
<d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">
<d:entry id="id4607705" d:title="Traversing/add(expr)">
<d:index d:value="add" d:title="Traversing/add(expr)"/>
<p class="title">Traversing/add(expr)</p>
<p>
Adds more elements, matched by the given expression, to the set of matched elements.
</p>
<p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>expr (<span class="arg-type" title="">String, DOMElement, Array<DOMElement></span>)</span>
-
An expression whose matched elements are added for String, a string of HTML to create on the fly for DOMElement or one or more Elements to add if an Array. A jQuery object is also accepted.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Finds all divs and makes a border. Then adds all paragraphs to the jQuery object to set their backgrounds yellow.
</p>
<pre>
<code class="javascript">$("div").css("border", "2px solid red")
.add("p")
.css("background", "yellow");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<p>Added this... (notice no border)</p>
</code>
</pre>
<h2>Example:</h2>
<p>
Adds more elements, matched by the given expression, to the set of matched elements.
</p>
<pre>
<code class="javascript">$("p").add("span").css("background", "yellow");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>Hello</p><span>Hello Again</span>
</code>
</pre>
<h2>Example:</h2>
<p>
Adds more elements, created on the fly, to the set of matched elements.
</p>
<pre>
<code class="javascript">$("p").clone().add("&lt;span>Again&lt;/span>").appendTo(document.body);
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>Hello</p>
</code>
</pre>
<h2>Example:</h2>
<p>
Adds one or more Elements to the set of matched elements.
</p>
<pre>
<code class="javascript">$("p").add(document.getElementById("a")).css("background", "yellow");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>Hello</p><span id="a">Hello Again</span>
</code>
</pre>
<h2>Example:</h2>
<p>
Demonstrates how to add (or push) elements to an existing collection
</p>
<pre>
<code class="javascript">var collection = $("p");
// capture the new collection
collection = collection.add(document.getElementById("a"));
collection.css("background", "yellow");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>Hello</p><span id="a">Hello Again</span>
</code>
</pre>
</d:entry>
<d:entry id="id4606200" d:title="Attributes/addClass(class)">
<d:index d:value="addClass" d:title="Attributes/addClass(class)"/>
<p class="title">Attributes/addClass(class)</p>
<p>
Adds the specified class(es) to each of the set of matched elements.
</p>
<p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>class (<span class="arg-type" title="A string of characters.">String</span>)</span>
-
One or more classes to add to the elements, these are separated by spaces.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Adds the class 'selected' to the matched elements.
</p>
<pre>
<code class="javascript">$("p:last").addClass("selected");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>Hello</p>
<p>and</p>
<p>Goodbye</p>
</code>
</pre>
<h2>Example:</h2>
<p>
Adds the classes 'selected' and 'highlight' to the matched elements.
</p>
<pre>
<code class="javascript">$("p:last").addClass("selected highlight");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>Hello</p>
<p>and</p>
<p>Goodbye</p>
</code>
</pre>
</d:entry>
<d:entry id="id4609537" d:title="Manipulation/after(content)">
<d:index d:value="after" d:title="Manipulation/after(content)"/>
<p class="title">Manipulation/after(content)</p>
<p>
Insert content after each of the matched elements.
</p>
<p>
<p>The elements must already be inserted into the document (you can't insert an element after another if it's not in the page).</p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>content (<span class="arg-type" title="">String, Element, jQuery</span>)</span>
-
Content to insert after each target.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Inserts some HTML after all paragraphs.
</p>
<pre>
<code class="javascript">$("p").after("<b>Hello</b>");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>I would like to say: </p>
</code>
</pre>
<h2>Example:</h2>
<p>
Inserts a DOM element after all paragraphs.
</p>
<pre>
<code class="javascript">$("p").after( document.createTextNode("Hello") );
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>I would like to say: </p>
</code>
</pre>
<h2>Example:</h2>
<p>
Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs.
</p>
<pre>
<code class="javascript">$("p").after( $("b") );
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <b>Hello</b>
<p>I would like to say: </p>
</code>
</pre>
</d:entry>
<d:entry id="id4670772" d:title="Ajax/ajaxComplete(callback)">
<d:index d:value="ajaxComplete" d:title="Ajax/ajaxComplete(callback)"/>
<p class="title">Ajax/ajaxComplete(callback)</p>
<p>
Attach a function to be executed whenever an AJAX request completes. This is an
<a href='Ajax_Events'>Ajax Event</a> .
</p>
<p>
The XMLHttpRequest and settings used for that request are passed as arguments to the callback.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
The function to execute.
<pre>function (event, XMLHttpRequest, ajaxOptions) {
this; // dom element listening
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Show a message when an AJAX request completes.
</p>
<pre>
<code class="javascript">$("#msg").ajaxComplete(function(event,request, settings){
$(this).append("<li>Request Complete.</li>");
});
</code>
</pre>
</d:entry>
<d:entry id="id4670838" d:title="Ajax/ajaxError(callback)">
<d:index d:value="ajaxError" d:title="Ajax/ajaxError(callback)"/>
<p class="title">Ajax/ajaxError(callback)</p>
<p>
Attach a function to be executed whenever an AJAX request fails. This is an
<a href='Ajax_Events'>Ajax Event</a> .
</p>
<p>
The XMLHttpRequest and settings used for that request are passed as arguments to the callback. A third argument, an exception object, is passed if an exception occured while processing the request.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
The function to execute.
<pre>function (event, XMLHttpRequest, ajaxOptions, thrownError) {
// thrownError only passed if an error was caught
this; // dom element listening
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Show a message when an AJAX request fails.
</p>
<pre>
<code class="javascript">$("#msg").ajaxError(function(event, request, settings){
$(this).append("<li>Error requesting page " + settings.url + "</li>");
});
</code>
</pre>
</d:entry>
<d:entry id="id4670907" d:title="Ajax/ajaxSend(callback)">
<d:index d:value="ajaxSend" d:title="Ajax/ajaxSend(callback)"/>
<p class="title">Ajax/ajaxSend(callback)</p>
<p>
Attach a function to be executed before an AJAX request is sent. This is an
<a href='Ajax_Events'>Ajax Event</a> .
</p>
<p>
The XMLHttpRequest and settings used for that request are passed as arguments to the callback.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
The function to execute.
<pre>function (event, XMLHttpRequest, ajaxOptions) {
this; // dom element listening
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Show a message before an AJAX request is sent.
</p>
<pre>
<code class="javascript">$("#msg").ajaxSend(function(evt, request, settings){
$(this).append("<li>Starting request at " + settings.url + "</li>");
});
</code>
</pre>
</d:entry>
<d:entry id="id4670972" d:title="Ajax/ajaxStart(callback)">
<d:index d:value="ajaxStart" d:title="Ajax/ajaxStart(callback)"/>
<p class="title">Ajax/ajaxStart(callback)</p>
<p>
Attach a function to be executed whenever an AJAX request begins and there is none already active. This is an
<a href='Ajax_Events'>Ajax Event</a> .
</p>
<p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
The function to execute.
<pre>function () {
this; // dom element listening
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Show a loading message whenever an AJAX request starts (and none is already active).
</p>
<pre>
<code class="javascript">$("#loading").ajaxStart(function(){
$(this).show();
});
</code>
</pre>
</d:entry>
<d:entry id="id4671032" d:title="Ajax/ajaxStop(callback)">
<d:index d:value="ajaxStop" d:title="Ajax/ajaxStop(callback)"/>
<p class="title">Ajax/ajaxStop(callback)</p>
<p>
Attach a function to be executed whenever all AJAX requests have ended. This is an
<a href='Ajax_Events'>Ajax Event</a> .
</p>
<p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
The function to execute.
<pre>function () {
this; // dom element listening
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Hide a loading message after all the AJAX requests have stopped.
</p>
<pre>
<code class="javascript">$("#loading").ajaxStop(function(){
$(this).hide();
});
</code>
</pre>
</d:entry>
<d:entry id="id4671093" d:title="Ajax/ajaxSuccess(callback)">
<d:index d:value="ajaxSuccess" d:title="Ajax/ajaxSuccess(callback)"/>
<p class="title">Ajax/ajaxSuccess(callback)</p>
<p>
Attach a function to be executed whenever an AJAX request completes successfully. This is an
<a href='Ajax_Events'>Ajax Event</a> .
</p>
<p>
The event object, XMLHttpRequest, and settings used for that request are passed as arguments to the callback.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
The function to execute.
<pre>function (event, XMLHttpRequest, ajaxOptions) {
this; // dom element listening
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Show a message when an AJAX request completes successfully.
</p>
<pre>
<code class="javascript">$("#msg").ajaxSuccess(function(evt, request, settings){
$(this).append("<li>Successful Request!</li>");
});
</code>
</pre>
</d:entry>
<d:entry id="id4602982" d:title="Selectors/all()">
<d:index d:value="all" d:title="Selectors/all()"/>
<p class="title">Selectors/all()</p>
<p>
Matches all elements.
</p>
<p>
Most useful when combined with a context to search in.
</p>
<h2>Example:</h2>
<p>
Finds every element (including head, body, etc).
</p>
<pre>
<code class="javascript">$("*").css("border","3px solid red");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <div>DIV</div>
<span>SPAN</span>
<p>P <button>Button</button></p>
</code>
</pre>
<h2>Example:</h2>
<p>
A common way to find all elements is to set the 'context' to document.body so elements like head, script, etc are left out.
</p>
<pre>
<code class="javascript">$("*", document.body).css("border","3px solid red");
</code>
</pre>
</d:entry>
<d:entry id="id4608787" d:title="Traversing/andSelf()">
<d:index d:value="andSelf" d:title="Traversing/andSelf()"/>
<p class="title">Traversing/andSelf()</p>
<p>
Add the previous selection to the current selection.
</p>
<p>
Useful for traversing elements, and then adding something that was matched before the last traversal.
</p>
<h2>Example:</h2>
<p>
Find all divs, and all the paragraphs inside of them, and give them both classnames. Notice the div doesn't have the yellow background color since it didn't use andSelf().
</p>
<pre>
<code class="javascript">$("div").find("p").andSelf().addClass("border");
$("div").find("p").addClass("background");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <div>
<p>First Paragraph</p>
<p>Second Paragraph</p>
</div>
</code>
</pre>
</d:entry>
<d:entry id="id4669045" d:title="Effects/animate(params, options)">
<d:index d:value="animate" d:title="Effects/animate(params, options)"/>
<p class="title">Effects/animate(params, options)</p>
<p>
A function for making custom animations.
</p>
<p>
The key aspect of this function is the object of style properties that will be animated, and to what end. Each key within the object represents a style property that will also be animated (e.g. "height", "top", or "opacity").<br xmlns=""/><br xmlns=""/>Note that properties should be specified using camel case, e.g. "marginLeft" instead of "margin-left."<br xmlns=""/><br xmlns=""/>The value associated with the key represents to what end the property will be animated. If a number is provided as the value, then the style property will be transitioned from its current state to that new number. Otherwise if the string "hide", "show", or "toggle" is provided, a default animation will be constructed for that property.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>params (<span class="arg-type" title="">Options</span>)</span>
-
A set of style attributes that you wish to animate, and to what end.
</li>
<li><span>options (<span class="arg-type" title="">Options </span>)</span>
-
A set of options with which to configure the animation.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
The first button shows how an unqueued animation works. It expands the div out to 90% width '''while''' the font-size is increasing. Once the font-size change is complete, the border animation will begin.
The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.
</p>
<pre>
<code class="javascript">$("#go1").click(function(){
$("#block1").animate( { width:"90%" }, { queue:false, duration:3000 } )
.animate( { fontSize:"24px" }, 1500 )
.animate( { borderRightWidth:"15px" }, 1500);
});
$("#go2").click(function(){
$("#block2").animate( { width:"90%"}, 1000 )
.animate( { fontSize:"24px" } , 1000 )
.animate( { borderLeftWidth:"15px" }, 1000);
});
$("#go3").click(function(){
$("#go1").add("#go2").click();
});
$("#go4").click(function(){
$("div").css({width:"", fontSize:"", borderWidth:""});
});
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <button id="go1">&raquo; Animate Block1</button>
<button id="go2">&raquo; Animate Block2</button>
<button id="go3">&raquo; Animate Both</button>
<button id="go4">&raquo; Reset</button>
<div id="block1">Block1</div>
<div id="block2">Block2</div>
</code>
</pre>
<h2>Example:</h2>
<p>
Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds.
</p>
<pre>
<code class="javascript">$("p").animate({
"height": "toggle", "opacity": "toggle"
}, { duration: "slow" });
</code>
</pre>
<h2>Example:</h2>
<p>
Animates all paragraph to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. It also will do it ''outside'' the queue, meaning it will automatically start without waiting for its turn.
</p>
<pre>
<code class="javascript">$("p").animate({
left: "50px", opacity: 1
}, { duration: 500, queue: false });
</code>
</pre>
<h2>Example:</h2>
<p>
An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function.
</p>
<pre>
<code class="javascript">$("p").animate({
"opacity": "show"
}, { "duration": "slow", "easing": "easein" });
</code>
</pre>
<h2>Example:</h2>
<p>
An example of using a callback function. The first argument is an array of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function.
</p>
<pre>
<code class="javascript">$("p").animate({
height:200, width:400, opacity: .5
}, 1000, "linear", function(){alert("all done");} );
</code>
</pre>
</d:entry>
<d:entry id="id4668873" d:title="Effects/animate(params, duration, easing, callback)">
<d:index d:value="animate" d:title="Effects/animate(params, duration, easing, callback)"/>
<p class="title">Effects/animate(params, duration, easing, callback)</p>
<p>
A function for making custom animations.
</p>
<p>
The key aspect of this function is the object of style properties that will be animated, and to what end. Each key within the object represents a style property that will also be animated (for example: "height", "top", or "opacity").<br xmlns=""/><br xmlns=""/>Note that properties should be specified using camel case, e.g. "marginLeft" instead of "margin-left."<br xmlns=""/><br xmlns=""/>The value associated with the key represents to what end the property will be animated. If a number is provided as the value, then the style property will be transitioned from its current state to that new number. Otherwise if the string "hide", "show", or "toggle" is provided, a default animation will be constructed for that property. Only properties that take numeric values are supported (e.g. backgroundColor is not supported).<br xmlns=""/><br xmlns=""/><p>As of jQuery 1.2 you can now animate properties by em and % (where applicable). Additionally, in jQuery 1.2, you can now do relative animations - specifying a "''+=''" or "''-=''" in front of the property value moves the element positively or negatively, relative to its current position.</p><br xmlns=""/><br xmlns=""/><p>As of jQuery 1.3 if you specify an animation duration of 0 then the animation will synchronously set the elements to their end state (this is different from old versions where there would be a brief, asynchronous, delay before the end state would be set).</p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>params (<span class="arg-type" title="">Options</span>)</span>
-
A set of style attributes that you wish to animate, and to what end.
</li>
<li><span>duration (<span class="arg-type" title="">String, Number </span>)</span>
-
A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
</li>
<li><span>easing (<span class="arg-type" title="">String </span>)</span>
-
The name of the easing effect that you want to use (plugin required). There are two built-in values, "linear" and "swing".
</li>
<li><span>callback (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
A function to be executed whenever the animation completes, executes once for each element animated against.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Click the button to animate the div with a number of different properties.
</p>
<pre>
<code class="javascript">// Using multiple unit types within one animation.
$("#go").click(function(){
$("#block").animate({
width: "70%",
opacity: 0.4,
marginLeft: "0.6in",
fontSize: "3em",
borderWidth: "10px"
}, 1500 );
});
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <button id="go">&raquo; Run</button>
<div id="block">Hello!</div>
</code>
</pre>
<h2>Example:</h2>
<p>
Shows a div animate with a relative move. Click several times on the buttons to see the relative animations queued up.
</p>
<pre>
<code class="javascript">$("#right").click(function(){
$(".block").animate({"left": "+=50px"}, "slow");
});
$("#left").click(function(){
$(".block").animate({"left": "-=50px"}, "slow");
});
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <button id="left">&laquo;</button> <button id="right">&raquo;</button>
<div class="block"></div>
</code>
</pre>
<h2>Example:</h2>
<p>
Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds.
</p>
<pre>
<code class="javascript">$("p").animate({
"height": "toggle", "opacity": "toggle"
}, "slow");
</code>
</pre>
<h2>Example:</h2>
<p>
Animates all paragraph to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds.
</p>
<pre>
<code class="javascript">$("p").animate({
"left": "50", "opacity": 1
}, 500);
</code>
</pre>
<h2>Example:</h2>
<p>
An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. Note, this code will do nothing unless the paragraph element is hidden.
</p>
<pre>
<code class="javascript">$("p").animate({
"opacity": "show"
}, "slow", "easein");
</code>
</pre>
</d:entry>
<d:entry id="id4603963" d:title="Selectors/animated()">
<d:index d:value="animated" d:title="Selectors/animated()"/>
<p class="title">Selectors/animated()</p>
<p>
Matches all elements that are currently being animated.
</p>
<p>
</p>
<h2>Example:</h2>
<p>
Change the color of any div that is animated.
</p>
<pre>
<code class="javascript">$("#run").click(function(){
$("div:animated").toggleClass("colored");
});
function animateIt() {
$("#mover").slideToggle("slow", animateIt);
}
animateIt();
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <button id="run">Run</button>
<div></div>
<div id="mover"></div>
<div></div>
</code>
</pre>
</d:entry>
<d:entry id="id4609218" d:title="Manipulation/append(content)">
<d:index d:value="append" d:title="Manipulation/append(content)"/>
<p class="title">Manipulation/append(content)</p>
<p>
Append content to the inside of every matched element.
</p>
<p>
This operation is the best way to insert elements inside, at the end, of all matched elements. It is similar to doing an appendChild to all the specified elements, adding them into the document.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>content (<span class="arg-type" title="">String, Element, jQuery</span>)</span>
-
Content to append to the target.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Appends some HTML to all paragraphs.
</p>
<pre>
<code class="javascript">$("p").append("<strong>Hello</strong>");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>I would like to say: </p>
</code>
</pre>
<h2>Example:</h2>
<p>
Appends an Element to all paragraphs.
</p>
<pre>
<code class="javascript">$("p").append(document.createTextNode("Hello"));
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>I would like to say: </p>
</code>
</pre>
<h2>Example:</h2>
<p>
Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.
</p>
<pre>
<code class="javascript">$("p").append( $("strong") );
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <strong>Hello world!!!</strong><p>I would like to say: </p>
</code>
</pre>
</d:entry>
<d:entry id="id4609318" d:title="Manipulation/appendTo(selector)">
<d:index d:value="appendTo" d:title="Manipulation/appendTo(selector)"/>
<p class="title">Manipulation/appendTo(selector)</p>
<p>
Append all of the matched elements to another, specified, set of elements. As of jQuery 1.3.2, returns all of the inserted elements.
</p>
<p>
This operation is, essentially, the reverse of doing a regular $(A).append(B), in that instead of appending B to A, you're appending A to B.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>selector (<span class="arg-type" title="">Selector</span>)</span>
-
target to which the content will be appended.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Appends all spans to the element with the ID "foo"
</p>
<pre>
<code class="javascript">$("span").appendTo("#foo"); // check append() examples
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <span>I have nothing more to say... </span>
<div id="foo">FOO! </div>
</code>
</pre>
</d:entry>
<d:entry id="id4605874" d:title="Attributes/attr(name)">
<d:index d:value="attr" d:title="Attributes/attr(name)"/>
<p class="title">Attributes/attr(name)</p>
<p>
Access a property on the first matched element. This method makes it easy to retrieve a property value from the first matched element. If the element does not have an attribute with such a name, undefined is returned. Attributes include title, alt, src, href, width, style, etc.
</p>
<p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>name (<span class="arg-type" title="A string of characters.">String</span>)</span>
-
The name of the property to access.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Finds the title attribute of the first <em> in the page.
</p>
<pre>
<code class="javascript">var title = $("em").attr("title");
$("div").text(title);
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <p>
Once there was a <em title="huge, gigantic">large</em> dinosaur...
</p>
The title of the emphasis is:<div></div>
</code>
</pre>
</d:entry>
<d:entry id="id4605932" d:title="Attributes/attr(properties)">
<d:index d:value="attr" d:title="Attributes/attr(properties)"/>
<p class="title">Attributes/attr(properties)</p>
<p>
Set a key/value object as properties to all matched elements.
</p>
<p>
This serves as the best way to set a large number of properties on all matched elements. Note that you must use 'className' as key if you want to set the class-Attribute. Or use .addClass( class ) or .removeClass( class ). Keep in mind this recursively calls attr( key, value ) or attr ( key, fn ), so if one of the properties you are passing is a function, the function will be evaluated and not stored as the attribute itself.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>properties (<span class="arg-type" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span>)</span>
-
Key/value pairs to set as object properties.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Set some attributes for all <img>s in the page.
</p>
<pre>
<code class="javascript">$("img").attr({
src: "/images/hat.gif",
title: "jQuery",
alt: "jQuery Logo"
});
$("div").text($("img").attr("alt"));
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <img />
<img />
<img />
<div><B>Attribute of Ajax</B></div>
</code>
</pre>
</d:entry>
<d:entry id="id4605994" d:title="Attributes/attr(key, value)">
<d:index d:value="attr" d:title="Attributes/attr(key, value)"/>
<p class="title">Attributes/attr(key, value)</p>
<p>
Set a single property to a value, on all matched elements.
</p>
<p>
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>key (<span class="arg-type" title="A string of characters.">String</span>)</span>
-
The name of the property to set.
</li>
<li><span>value (<span class="arg-type" title="A simple Javascript object..">Object</span>)</span>
-
The value to set the property to.
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Disables buttons greater than the 1st button.
</p>
<pre>
<code class="javascript">$("button:gt(1)").attr("disabled","disabled");
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <button>0th Button</button>
<button>1st Button</button>
<button>2nd Button</button>
</code>
</pre>
</d:entry>
<d:entry id="id4606054" d:title="Attributes/attr(key, fn)">
<d:index d:value="attr" d:title="Attributes/attr(key, fn)"/>
<p class="title">Attributes/attr(key, fn)</p>
<p>
Set a single property to a computed value, on all matched elements.
</p>
<p>
Instead of supplying a string value as described
<a href='#keyvalue'>above</a> , a function is provided that computes the value.
</p>
<h2>Params</h2>
<p>
<ul class="params">
<li><span>key (<span class="arg-type" title="A string of characters.">String</span>)</span>
-
The name of the property to set.
</li>
<li><span>fn (<span class="arg-type" title="A reference to a Javascript function.">Function</span>)</span>
-
A function returning the value to set. Scope: Current element, argument: Index of current element
<pre>function callback(indexArray) {
// indexArray == position in the jQuery object
this; // dom element
}
</pre>
</li>
</ul>
</p>
<h2>Example:</h2>
<p>
Sets id for divs based on the position in the page.
</p>
<pre>
<code class="javascript">$("div").attr("id", function (arr) {
return "div-id" + arr;
})
.each(function () {
$("span", this).html("(ID = '<b>" + this.id + "</b>')");
});
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <div>Zero-th <span></span></div>
<div>First <span></span></div>
<div>Second <span></span></div>
</code>
</pre>
<h2>Example:</h2>
<p>
Sets src attribute from title attribute on the image.
</p>
<pre>
<code class="javascript">$("img").attr("src", function() {
return "/images/" + this.title;
});
</code>
</pre>
<h3>HTML:</h3>
<pre>
<code class="html"> <img title="hat.gif"/>
<img title="hat-old.gif"/>
<img title="hat2-old.gif"/>
</code>
</pre>
</d:entry>
<d:entry id="id4604724" d:title="Selectors/attributeContains(attribute, value)">
<d:index d:value="attributeContains" d:title="Selectors/attributeContains(attribute, value)"/>
<p class="title">Selectors/attributeContains(attribute, value)</p>
<p>
Matches elements that have the specified attribute and it contains a certain value.
</p>
<p>