jquery accordion not re-initiating after an asp.Net postback

前端 未结 2 1733
礼貌的吻别
礼貌的吻别 2020-12-10 09:10

I\'m firing up a jquery accordion with:

$(document).ready(function(){
   $(\'#accordion\').accordion();
});

Problem is this is an .asp.NET

2条回答
  •  误落风尘
    2020-12-10 09:51

    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InitAccordion);
    function InitAccordion(){       
       $('#accordion').accordion();}
    

    This will work for postback and asyncpostback Raised after all content on the page is refreshed as a result of either a synchronous or an asynchronous postback. http://msdn.microsoft.com/en-us/library/bb397523(v=vs.100).aspx

提交回复
热议问题