开发者

Expanding jQuery accordion

开发者 https://www.devze.com 2023-02-13 03:10 出处:网络
Lets say you have 5 \"accordions\" (i.e. 5 expandible/collapsible sections). Is it pos开发者_高级运维sible to preset one of these sections to be expanded when the page is loaded?Needs collapsible: tru

Lets say you have 5 "accordions" (i.e. 5 expandible/collapsible sections). Is it pos开发者_高级运维sible to preset one of these sections to be expanded when the page is loaded?


Needs collapsible: true.

Code examples Initialize a accordion with the active option specified.

$( ".selector" ).accordion({ active: 2 });

Get or set the active option, after init. //getter

var active = $( ".selector" ).accordion( "option", "active" );

//setter

  $( ".selector" ).accordion( "option", "active", 2 );

I hope that helps. You may check out http://jqueryui.com/demos/accordion/


$( ".selector" ).accordion({ active: 2 });

if you don't specify an option explicitly it'll default to first child here is a demonstration maybe it'll help


yes there is active property to determine the default expanded section

you can see it here active

0

精彩评论

暂无评论...
验证码 换一张
取 消