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
|
<ul class="UIAPIPlugin-toc">
<li><a href="#overview">Overview</a></li>
<li><a href="#options">Options</a></li>
<li><a href="#events">Events</a></li>
<li><a href="#methods">Methods</a></li>
<li><a href="#theming">Theming</a></li>
</ul>
<div class="UIAPIPlugin">
<h1>jQuery UI Accordion</h1>
<div id="overview">
<h2 class="top-header">Overview</h2>
<div id="overview-main">
<p>Make the selected elements Accordion widgets. Semantic requirements:</p>
<p>The markup of your accordion container needs pairs of headers and content panels:</p>
<pre><div id="accordion">
<h3><a href="#">First header</a></h3>
<div>First content</div>
<h3><a href="#">Second header</a></h3>
<div>Second content</div>
</div></pre>
<p>If you use a different element for the header, specify the header-option with an appropriate selector, eg. header: 'a.header'. The content element must be always next to its header.</p>
<p>If you have links inside the accordion content and use a-elements as headers, add a class to them and use that as the header, eg. header: 'a.header'.</p>
<p>Use activate(Number) to change the active content programmatically.</p>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/UI/API/1.8/Accordion?section=1" title="Edit section: NOTE: If you want multiple sections open at once, don't use an accordion">edit</a>]</div><a name="NOTE:_If_you_want_multiple_sections_open_at_once.2C_don.27t_use_an_accordion"></a><h4>NOTE: If you want multiple sections open at once, don't use an accordion</h4>
<p>An accordion doesn't allow more than one content panel to be open at the same time, and it takes a lot of effort to do that. If you are looking for a widget that allows more than one content panel to be open, don't use this. Usually it can be written with a few lines of jQuery instead, something like this:</p>
<pre>jQuery(document).ready(function(){
$('.accordion .head').click(function() {
$(this).next().toggle();
return false;
}).next().hide();
});</pre>
<p>Or animated:</p>
<pre>jQuery(document).ready(function(){
$('.accordion .head').click(function() {
$(this).next().toggle('slow');
return false;
}).next().hide();
});</pre>
</div>
<div id="overview-dependencies">
<h3>Dependencies</h3>
<ul>
<li>UI Core</li>
<li>UI Effects Core (Optional - only for non-default animations)</li>
</ul>
</div>
<div id="overview-example">
<h3>Example</h3>
<div id="overview-example" class="example">
<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
<p><div id="demo" class="tabs-container" rel="310">
A simple jQuery UI Accordion.<br />
</p>
<pre>$("#accordion").accordion();
</pre>
<p></div><div id="source" class="tabs-container">
</p>
<pre><!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("#accordion").accordion();
});
</script>
</head>
<body style="font-size:62.5%;">
<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<div>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</p>
</div>
<h3><a href="#">Section 2</a></h3>
<div>
<p>
Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
suscipit faucibus urna.
</p>
</div>
<h3><a href="#">Section 3</a></h3>
<div>
<p>
Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
</p>
<ul>
<li>List item one</li>
<li>List item two</li>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<div>
<p>
Cras dictum. Pellentesque habitant morbi tristique senectus et netus
et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
mauris vel est.
</p>
<p>
Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
inceptos himenaeos.
</p>
</div>
</div>
</body>
</html>
</pre>
<p></div>
</p><p></div>
</div>
</div>
<div id="options">
<h2 class="top-header">Options</h2>
<ul class="options-list">
<li class="option" id="option-disabled">
<div class="option-header">
<h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">false</dd>
</dl>
</div>
<div class="option-description">
<p>Disables (true) or enables (false) the accordion. Can be set when initialising (first creating) the accordion.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>disabled</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ disabled: true });</code></pre>
</dd>
<dt>
Get or set the <code>disabled</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var disabled = $( ".selector" ).accordion( "option", "disabled" );
//setter
$( ".selector" ).accordion( "option", "disabled", true );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-active">
<div class="option-header">
<h3 class="option-name"><a href="#option-active">active</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Selector, Element, jQuery, Boolean, Number</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">first child</dd>
</dl>
</div>
<div class="option-description">
<p>Selector for the active element. Set to false to display none at start. Needs <code>collapsible: true</code>.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>active</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ active: 2 });</code></pre>
</dd>
<dt>
Get or set the <code>active</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var active = $( ".selector" ).accordion( "option", "active" );
//setter
$( ".selector" ).accordion( "option", "active", 2 );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-animated">
<div class="option-header">
<h3 class="option-name"><a href="#option-animated">animated</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean, String</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">'slide'</dd>
</dl>
</div>
<div class="option-description">
<p>Choose your favorite animation, or disable them (set to false). In addition to the default, 'bounceslide' and all defined easing methods are supported ('bounceslide' requires UI Effects Core).</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>animated</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ animated: 'bounceslide' });</code></pre>
</dd>
<dt>
Get or set the <code>animated</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var animated = $( ".selector" ).accordion( "option", "animated" );
//setter
$( ".selector" ).accordion( "option", "animated", 'bounceslide' );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-autoHeight">
<div class="option-header">
<h3 class="option-name"><a href="#option-autoHeight">autoHeight</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">true</dd>
</dl>
</div>
<div class="option-description">
<p>If set, the highest content part is used as height reference for all other parts. Provides more consistent animations.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>autoHeight</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ autoHeight: false });</code></pre>
</dd>
<dt>
Get or set the <code>autoHeight</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var autoHeight = $( ".selector" ).accordion( "option", "autoHeight" );
//setter
$( ".selector" ).accordion( "option", "autoHeight", false );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-clearStyle">
<div class="option-header">
<h3 class="option-name"><a href="#option-clearStyle">clearStyle</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">false</dd>
</dl>
</div>
<div class="option-description">
<p>If set, clears height and overflow styles after finishing animations. This enables accordions to work with dynamic content. Won't work together with autoHeight.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>clearStyle</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ clearStyle: true });</code></pre>
</dd>
<dt>
Get or set the <code>clearStyle</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var clearStyle = $( ".selector" ).accordion( "option", "clearStyle" );
//setter
$( ".selector" ).accordion( "option", "clearStyle", true );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-collapsible">
<div class="option-header">
<h3 class="option-name"><a href="#option-collapsible">collapsible</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">false</dd>
</dl>
</div>
<div class="option-description">
<p>Whether all the sections can be closed at once. Allows collapsing the active section by the triggering event (click is the default).</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>collapsible</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ collapsible: true });</code></pre>
</dd>
<dt>
Get or set the <code>collapsible</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var collapsible = $( ".selector" ).accordion( "option", "collapsible" );
//setter
$( ".selector" ).accordion( "option", "collapsible", true );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-event">
<div class="option-header">
<h3 class="option-name"><a href="#option-event">event</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">String</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">'click'</dd>
</dl>
</div>
<div class="option-description">
<p>The event on which to trigger the accordion.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>event</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ event: 'mouseover' });</code></pre>
</dd>
<dt>
Get or set the <code>event</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var event = $( ".selector" ).accordion( "option", "event" );
//setter
$( ".selector" ).accordion( "option", "event", 'mouseover' );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-fillSpace">
<div class="option-header">
<h3 class="option-name"><a href="#option-fillSpace">fillSpace</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">false</dd>
</dl>
</div>
<div class="option-description">
<p>If set, the accordion completely fills the height of the parent element. Overrides autoheight.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>fillSpace</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ fillSpace: true });</code></pre>
</dd>
<dt>
Get or set the <code>fillSpace</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var fillSpace = $( ".selector" ).accordion( "option", "fillSpace" );
//setter
$( ".selector" ).accordion( "option", "fillSpace", true );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-header">
<div class="option-header">
<h3 class="option-name"><a href="#option-header">header</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Selector, jQuery</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">'> li > :first-child,> :not(li):even'</dd>
</dl>
</div>
<div class="option-description">
<p>Selector for the header element.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>header</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ header: 'h3' });</code></pre>
</dd>
<dt>
Get or set the <code>header</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var header = $( ".selector" ).accordion( "option", "header" );
//setter
$( ".selector" ).accordion( "option", "header", 'h3' );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-icons">
<div class="option-header">
<h3 class="option-name"><a href="#option-icons">icons</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Object</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">{ 'header': 'ui-icon-triangle-1-e', 'headerSelected': 'ui-icon-triangle-1-s' }</dd>
</dl>
</div>
<div class="option-description">
<p>Icons to use for headers. Icons may be specified for 'header' and 'headerSelected', and we recommend using the icons native to the jQuery UI CSS Framework manipulated by <a href="http://www.themeroller.com" class="external text" title="http://www.themeroller.com">jQuery UI ThemeRoller</a></p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>icons</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ icons: { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' } });</code></pre>
</dd>
<dt>
Get or set the <code>icons</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var icons = $( ".selector" ).accordion( "option", "icons" );
//setter
$( ".selector" ).accordion( "option", "icons", { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' } );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-navigation">
<div class="option-header">
<h3 class="option-name"><a href="#option-navigation">navigation</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Boolean</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default">false</dd>
</dl>
</div>
<div class="option-description">
<p>If set, looks for the anchor that matches location.href and activates it. Great for href-based state-saving. Use navigationFilter to implement your own matcher.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>navigation</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ navigation: true });</code></pre>
</dd>
<dt>
Get or set the <code>navigation</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var navigation = $( ".selector" ).accordion( "option", "navigation" );
//setter
$( ".selector" ).accordion( "option", "navigation", true );</code></pre>
</dd>
</dl>
</div>
</li>
<li class="option" id="option-navigationFilter">
<div class="option-header">
<h3 class="option-name"><a href="#option-navigationFilter">navigationFilter</a></h3>
<dl>
<dt class="option-type-label">Type:</dt>
<dd class="option-type">Function</dd>
<dt class="option-default-label">Default:</dt>
<dd class="option-default"> </dd>
</dl>
</div>
<div class="option-description">
<p>Overwrite the default location.href-matching with your own matcher.</p>
</div>
<div class="option-examples">
<h4>Code examples</h4>
<dl class="option-examples-list">
<dt>
Initialize a accordion with the <code>navigationFilter</code> option specified.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({ navigationFilter: function(){ ... } });</code></pre>
</dd>
<dt>
Get or set the <code>navigationFilter</code> option, after init.
</dt>
<dd>
<pre><code>//getter
var navigationFilter = $( ".selector" ).accordion( "option", "navigationFilter" );
//setter
$( ".selector" ).accordion( "option", "navigationFilter", function(){ ... } );</code></pre>
</dd>
</dl>
</div>
</li>
</ul>
</div>
<div id="events">
<h2 class="top-header">Events</h2>
<ul class="events-list">
<li class="event" id="event-change">
<div class="event-header">
<h3 class="event-name"><a href="#event-change">change</a></h3>
<dl>
<dt class="event-type-label">Type:</dt>
<dd class="event-type">accordionchange</dd>
</dl>
</div>
<div class="event-description">
<p>This event is triggered every time the accordion changes. If the accordion is animated, the event will be triggered upon completion of the animation; otherwise, it is triggered immediately.
</p>
<pre>$('.ui-accordion').bind('accordionchange', function(event, ui) {
ui.newHeader // jQuery object, activated header
ui.oldHeader // jQuery object, previous header
ui.newContent // jQuery object, activated content
ui.oldContent // jQuery object, previous content
});</pre></p>
</div>
<div class="event-examples">
<h4>Code examples</h4>
<dl class="event-examples-list">
<dt>
Supply a callback function to handle the <code>change</code> event as an init option.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({
change: function(event, ui) { ... }
});</code></pre>
</dd>
<dt>
Bind to the <code>change</code> event by type: <code>accordionchange</code>.
</dt>
<dd>
<pre><code>$( ".selector" ).bind( "accordionchange", function(event, ui) {
...
});</code></pre>
</dd>
</dl>
</div>
</li>
<p>
<li class="event" id="event-changestart">
<div class="event-header">
<h3 class="event-name"><a href="#event-changestart">changestart</a></h3>
<dl>
<dt class="event-type-label">Type:</dt>
<dd class="event-type">accordionchangestart</dd>
</dl>
</div>
<div class="event-description">
<p>This event is triggered every time the accordion starts to change.
</p>
<pre>$('.ui-accordion').bind('accordionchangestart', function(event, ui) {
ui.newHeader // jQuery object, activated header
ui.oldHeader // jQuery object, previous header
ui.newContent // jQuery object, activated content
ui.oldContent // jQuery object, previous content
});</pre></p>
</div>
<div class="event-examples">
<h4>Code examples</h4>
<dl class="event-examples-list">
<dt>
Supply a callback function to handle the <code>changestart</code> event as an init option.
</dt>
<dd>
<pre><code>$( ".selector" ).accordion({
changestart: function(event, ui) { ... }
});</code></pre>
</dd>
<dt>
Bind to the <code>changestart</code> event by type: <code>accordionchangestart</code>.
</dt>
<dd>
<pre><code>$( ".selector" ).bind( "accordionchangestart", function(event, ui) {
...
});</code></pre>
</dd>
</dl>
</div>
</li>
</ul>
</div>
<div id="methods">
<h2 class="top-header">Methods</h2>
<ul class="methods-list">
<li class="method" id="method-destroy">
<div class="method-header">
<h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "destroy"
)</dd>
</dl>
</div>
<div class="method-description">
<p>Remove the accordion functionality completely. This will return the element back to its pre-init state.</p>
</div>
</li>
<p>
<li class="method" id="method-disable">
<div class="method-header">
<h3 class="method-name"><a href="#method-disable">disable</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "disable"
)</dd>
</dl>
</div>
<div class="method-description">
<p>Disable the accordion.</p>
</div>
</li>
<li class="method" id="method-enable">
<div class="method-header">
<h3 class="method-name"><a href="#method-enable">enable</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "enable"
)</dd>
</dl>
</div>
<div class="method-description">
<p>Enable the accordion.</p>
</div>
</li>
<li class="method" id="method-option">
<div class="method-header">
<h3 class="method-name"><a href="#method-option">option</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "option"
, optionName
, <span class="optional">[</span>value<span class="optional">] </span>
)</dd>
</dl>
</div>
<div class="method-description">
<p>Get or set any accordion option. If no value is specified, will act as a getter.</p>
</div>
</li>
<li class="method" id="method-option">
<div class="method-header">
<h3 class="method-name"><a href="#method-option">option</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "option"
, options
)</dd>
</dl>
</div>
<div class="method-description">
<p>Set multiple accordion options at once by providing an options object.</p>
</div>
</li>
<li class="method" id="method-widget">
<div class="method-header">
<h3 class="method-name"><a href="#method-widget">widget</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "widget"
)</dd>
</dl>
</div>
<div class="method-description">
<p>Returns the .ui-accordion element.</p>
</div>
</li>
<li class="method" id="method-activate">
<div class="method-header">
<h3 class="method-name"><a href="#method-activate">activate</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "activate"
, index
)</dd>
</dl>
</div>
<div class="method-description">
<p>Activate a content part of the Accordion programmatically. The index can be a zero-indexed number to match the position of the header to close or a Selector matching an element. Pass <code>false</code> to close all (only possible with <code>collapsible:true</code>).</p>
</div>
</li>
<li class="method" id="method-resize">
<div class="method-header">
<h3 class="method-name"><a href="#method-resize">resize</a></h3>
<dl>
<dt class="method-signature-label">Signature:</dt>
<dd class="method-signature">.accordion( "resize"
)</dd>
</dl>
</div>
<div class="method-description">
<p>Recompute heights of the accordion contents when using the fillSpace option and the container height changed. For example, when the container is a resizable, this method should be called by its resize-event.</p>
</div>
</li>
</ul>
</div>
<div id="theming">
<h2 class="top-header">Theming</h2>
<p>The jQuery UI Accordion plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.
</p>
<p>If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.accordion.css stylesheet that can be modified. These classes are highlighed in bold below.
</p>
<h3>Sample markup with jQuery UI CSS Framework classes</h3>
<div class="<strong>ui-accordion</strong> ui-widget ui-helper-reset"><br />
<h3 class="<strong>ui-accordion-header</strong> ui-helper-reset ui-state-active ui-corner-top"><br />
<span class="ui-icon ui-icon-triangle-1-s"/><br />
<a href="#">Section 1</a><br />
</h3><br />
<div class="<strong>ui-accordion-content</strong> ui-helper-reset ui-widget-content ui-corner-bottom <strong>ui-accordion-content-active</strong>"><br />
Section 1 content<br />
</div><br />
<h3 class="<strong>ui-accordion-header</strong> ui-helper-reset ui-state-default ui-corner-all"><br />
<span class="ui-icon ui-icon-triangle-1-e"/><br />
<a href="#">Section 2</a><br />
</h3><br />
<div class="<strong>ui-accordion-content</strong> ui-helper-reset ui-widget-content ui-corner-bottom"><br />
Section 2 content<br />
</div><br />
<h3 class="<strong>ui-accordion-header</strong> ui-helper-reset ui-state-default ui-corner-all"><br />
<span class="ui-icon ui-icon-triangle-1-e"/><br />
<a href="#">Section 3</a><br />
</h3><br />
<div class="<strong>ui-accordion-content</strong> ui-helper-reset ui-widget-content ui-corner-bottom"><br />
Section 3 content<br />
</div><br />
</div><br />
<p class="theme-note">
<strong>
Note: This is a sample of markup generated by the accordion plugin, not markup you should use to create a accordion. The only markup needed for that is <br /><div><br />
   <h3><a href="#">Section 1</a></h3><br />
   <div><br />
      Section 1 content<br />
   </div><br />
   <h3><a href="#">Section 2</a></h3><br />
   <div><br />
      Section 2 content<br />
   </div><br />
   <h3><a href="#">Section 3</a></h3><br />
   <div><br />
      Section 3 content<br />
   </div><br />
</div>.
</strong>
</p>
</div>
</div>
</p><!--
Pre-expand include size: 36551 bytes
Post-expand include size: 61985 bytes
Template argument size: 35253 bytes
Maximum: 2097152 bytes
-->
<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3773-1!1!0!!en!2 and timestamp 20101025190216 -->
|