Keep the current jQuery accordion pane open after ASP.NET postback?

后端 未结 13 2097
遥遥无期
遥遥无期 2020-12-09 09:57

I have a jquery accordion on an asp.net aspx weppage. Inside the panes, I have asp.net buttons. When I click on the button, the pane I was in, closes and reloads the page,

相关标签:
13条回答
  • 2020-12-09 10:36

    It is working on my side Please check......

    $(document).ready(function () {
        var activeIndex = parseInt($('#<%=hidAccordionIndex.ClientID %>').val());
        alert(activeIndex);
        $("#accordion").accordion({            
            active: activeIndex,
            beforeActivate: function (event, ui) {                
                var index = $(this).children('h3').index(ui.newHeader);
                $('#<%=hidAccordionIndex.ClientID %>').val(index);                
            }            
        });        
    });
    
    0 讨论(0)
提交回复
热议问题