jQuery UI:手风琴回调 [英] JQuery UI: Accordion callbacks
本文介绍了jQuery UI:手风琴回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要我的javascript仅在打开手风琴的某个部分时执行回调,截至目前,由于我仅使用click函数,因此当我打开或关闭一个部分时它才执行回调.有什么方法可以修改我现有的点击功能,使其仅在给定的部分被激活时运行?
I need my javascript to only do the callback when I OPEN a section on the accordion, as of right now it does a callback when I open OR close a section because I'm only using a click function. Is there a way I can modify my existing click function to only run when the given section is activated?
我当前的点击功能:
$("a#mimetypes").click(function() {
$("span#mimetypesthrobber").loading(true, { max: 1500 })
$.getJSON("../mimetypes", function(data) {
//callback
});
});
谢谢!
我已经在手风琴的另一部分进行了尝试,但无法正常工作:
I already tried this with another part of the accordion and it wasn't working properly:
$('.ui-accordion').bind('accordionchange', function(event, ui) {
if (ui.newHeader == "Encoders") {
EncodersGet();
}
});
推荐答案
查看全文