简体   繁体   English

如何触发jQuery UI手风琴的更改事件?

[英]How to fire change event for jquery ui accordion?

I know how to us the change event for jquery ui Accordion. 我知道如何为jquery ui手风琴提供change事件。

Its change event gets fired in my case when clicking any of the accordion( as that is the defalut behaviour of accordion) and I am able to get all the data in this event like newContent, newHeader, etc. 在我的情况下,单击任何手风琴都会触发它的change事件(因为这是手风琴的默认行为),我能够获取此事件中的所有数据,例如newContent,newHeader等。

But I want to manually fire the change event for Accordion and I don't know how to do it. 但是我想手动触发Accordion的change事件,但我不知道该怎么做。

Also can I fire the change event while the accordion is loaded. 也可以在加载手风琴时触发change事件。

I have an accordion on my page and I want to fire "change event" for each of them as soon as the accordion is loaded as I have my ajax code written in "change event handler" 我的页面上有一个手风琴,当我的ajax代码写在“ change event handler”中时,我想在每个手风琴加载后为它们触发“ change event”

以下代码可以完成您想要的工作。

$("#accordion").accordion('activate', itemIndex);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM