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

triggerTab(position)

Activate a tab programmatically with the given position (no zero-based index), as if the tab itself were clicked.

返回值

jQuery

参数

  • position (Number): An integer specifying the position of the tab (no zero-based index) to be activated. If this parameter is omitted, the first tab will be activated.

示例

说明:

Activate the second tab of the tab interface contained in <div id="container">.

jQuery 代码:
$('#container').triggerTab(2);

说明:

Activate the first tab of the tab interface contained in <div id="container">.

jQuery 代码:
$('#container').triggerTab(1);

说明:

Activate the first tab of the tab interface contained in <div id="container">.

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