开发者

jQuery Accordion Last section to diplay by defautl?

How can i make last section as active in accordion by default?

 $开发者_开发问答("#accordion").accordion("active", last)

as I will have a Dynamic set of sections in the accordion.

By default i wan the last section to be active

How can i do that?


The zero-based index of the panel that is active (open). A negative value selects panels going backward from the last panel.

$("#accordion").accordion({
  active: -1
});


Try ":last" as the active selector. Pick ONE of these options depending on your style and preferences:

$("#accordion").accordion("option", "active", ":last"); // this one
$("#accordion").accordion({"active" : ":last"}); // OR this one; not both

[edited: it seems like you also need to pass "option" or use an options map]


$( "#accordion" ).accordion( "option", "active", -1 ); works fine.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜