每當打開手風琴選項卡以獲取該選項卡的內容時,我都想要啓動ajax調用。爲此,我需要知道什麼標籤留下,哪些標籤打開。 從jQuery文檔:從jquery.ui.accordion獲取新舊內容的ID
$('.ui-accordion').bind('accordionchange', function(event, ui) {
ui.newHeader // jQuery object, activated header
ui.oldHeader // jQuery object, previous header
ui.newContent // jQuery object, activated content
ui.oldContent // jQuery object, previous content
});
在Firebug我可以看到我需要的是ui.newContent或ui.oldContent。
這些似乎是真正的div,所以我不知何故需要得到他們的id。
function OnAccordionChanged(event, ui) {
//get the id of the old tab
var oldId = ui.oldContent.id;
//apply (business) filters
//get the id of the new tab
//fetch the content
//append to new tab
//party
}
它基本上是檸第一步,我會失敗:■