| accordion ( options ) | ใช้กำหนดให้ ทุก element ภายใน set มีคุณสมบัติ accordion ( เมนูแบบสไลด์ ) |
|---|---|
| disabled | ใช้กำหนดสถานะของการ accordion ว่ายังใช้งานไม่ได้ ใช่หรือไม่ (default=false) |
| active | ใช้กำหนด element ที่จะถูก active ในตอนแรก |
| animated | ใช้กำหนดลักษณะของการ animate ของ accordion (default=slide) |
| autoHeight | ใช้กำหนดความสูงว่าจะเป็นแบบ auto หรือไม่ (default=true) |
| clearStyle | (default=false) |
| collapsible | (default=false) |
| event | ใช้กำหนด event ที่จะทำให้เกิด accordion ขึ้น (default=click) |
| header | ใช้กำหนด header element (default=> li > :first-child,> :not(li):even) |
| navigation | (default=false) |
| navigationFilter | (default=null) |
| change | ใช้กำหนด function ที่จะถูกเรียกใช้เมื่อการ accordion เปลี่ยนแปลง |
| changestart | ใช้กำหนด function ที่จะถูกเรียกใช้เมื่อการ accordion เริ่มต้นการเปลี่ยนแปลง |
syntax:accordion ( options )
return type:void, element
content:ใช้กำหนดให้ ทุก element ภายใน set มีคุณสมบัติ accordion ( เมนูแบบสไลด์ ) โดย options ให้กำหนดค่า config ต่างๆ ให้กับการ accordion ได้แก่ disabled, active, animated, autoHeight, clearStyle, collapsible, event, header, navigation, navigationFilter, change, changestart
example:$("div.accordion").accordion ( { autoHeight: false } ); var autoHeight = $("div.accordion").accordion ( "option", "autoHeight" ); // ใช้คืนค่าข้อมูลของ property ที่กำหนด $("div.accordion").accordion ( "option", "autoHeight", false ); // ใช้กำหนดค่าให้กับ property ที่กำหนด
config:disabled
return type:boolean
content:ใช้กำหนดสถานะของการ accordion ว่ายังใช้งานไม่ได้ ใช่หรือไม่ (default=false)
example:$("div.accordion").accordion ( { disabled: true } );
config:active
return type:selector, element, number, boolean
content:ใช้กำหนด element ที่จะถูก active ในตอนแรก โดยสามารถกำหนดได้ในหลายลักษณะ เช่น ตำแหน่ง หรือกำหนด false คือไม่มีเลย หรือกำหนด true คือทั้งหมด (default=first child)
example:$("div.accordion").accordion ( { active: "first child" } );
config:animated
return type:boolean, string
content:ใช้กำหนดลักษณะของการ animate ของ accordion (default=slide) เช่น blind, clip, drop, explode, fade, fold, puff, slide, scale, bounce, highlight, pulsate, shake, size, transfer เป็นต้น
example:$("div.accordion").accordion ( { animated: "fade" } );
config:autoHeight
return type:boolean
content:ใช้กำหนดความสูงว่าจะเป็นแบบ auto หรือไม่ (default=true)
example:$("div.accordion").accordion ( { autoHeight: true } );
config:clearStyle
return type:boolean
content:(default=false)
example:$("div.accordion").accordion ( { clearStyle: true } );
config:collapsible
return type:boolean
content:(default=false)
example:$("div.accordion").accordion ( { collapsible: true } );
config:event
return type:string
content:ใช้กำหนด event ที่จะทำให้เกิด accordion ขึ้น (default=click)
example:$("div.accordion").accordion ( { event: "mouseover" } );
config:header
return type:string
content:ใช้กำหนด header element (default=> li > :first-child,> :not(li):even)
example:$("div.accordion").accordion ( { header: "> li > :first-child,> :not(li):even" } );
config:navigation
return type:boolean
content:(default=false)
example:$("div.accordion").accordion ( { navigation: true } );
config:navigationFilter
return type:function
content:(default=null)
example:$("div.accordion").accordion ( { navigationFilter: null } );
config:change
return type:function
content:ใช้กำหนด function ที่จะถูกเรียกใช้เมื่อการ accordion เปลี่ยนแปลง โดยจะมี parameter 2 ตัว ได้แก่ event object และ object ที่มี property ต่างๆ
example:$("div.accordion").accordion ( { change: function(event,object) { alert ( "accordion change" ); } } );
config:changestart
return type:function
content:ใช้กำหนด function ที่จะถูกเรียกใช้เมื่อการ accordion เริ่มต้นการเปลี่ยนแปลง โดยจะมี parameter 2 ตัว ได้แก่ event object และ object ที่มี property ต่างๆ
example:$("div.accordion").accordion ( { changestart: function(event,object) { alert ( "accordion change start" ); } } );