jQuery UI手风琴激活 [英] jQuery UI Accordion activate

查看:111
本文介绍了jQuery UI手风琴激活的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何执行此操作,或者我是否可以执行此操作。我有一个jQuery UI手风琴,有多个部分,每个部分包含多个锚标签,每个标签具有唯一的字符串ID。

I'm not getting how to do this, or if I can do this. I have a jQuery UI Accordion, multiple sections with each section containing multiple anchor tags each with a unique string id.

我希望能够打开手风琴具有给定id的特定元素的位置。就像说id item117。我可以使用

I'd like to be able to have the accordion open to where a particular element with a given id is. Like say id "item117". Can I use something like

$('#accordion').activate('activate','#item117');

甚至

$('#accordion').activate('activate',117);

我已经尝试了这些方法和一些变体,但无法解决。在我想开始工作的情况下,手风琴应该已经打开到第二部分的结尾。

I've tried those and some variations but can't get it to go. In the case I was trying to get working, the accordion should've opened to the end of the second section.

我仍然没有得到这个,所以也许我也在做其他错误。我将其简化为以下示例页面: http://www.ofthejungle.com/testaccordion。 php 请查看它及其来源。

I'm still not getting this, so maybe I'm doing something else wrong as well. I've stripped it down to an example page here: http://www.ofthejungle.com/testaccordion.php Please have a look at it and its source.

推荐答案

摘自文档:

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

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

这篇关于jQuery UI手风琴激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆