jQuery API 返回首页目录 | jQuery API 中英文对照版
activate(index)

activate(index)

Activate a content part of the Accordion programmatically with the position zero-based index. If the index is not specified, it defaults to zero, if it is an invalid index, eg. a string, nothing happens. Requires jQuery core revision >= 557.

返回值

jQuery

参数

  • index (Number): An Integer specifying the zero-based index of the content to be activated. Defaults to 0.

示例

说明:

Activate the second content of the Accordion contained in <div id="accordion">.

jQuery 代码:
$('#accordion').activate(1);
说明:

Activate the first content of the Accordion contained in <ul id="nav">.

jQuery 代码:
$('#nav').activate();
相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog