Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my page every Second Refersh using ajax...how to set last open accordion tab when page loge

ASP.NET
<pre lang="HTML"><div id="accordion" runat="server">
                       </div>



Javascript


JavaScript
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>

        setInterval(function () {


            getTotal();
            $("#accordion").accordion();
            $("#accordion").accordion({
                active: $(".defaultOpen")
            });
            getIBtrade();
            //scrollCallback();



        }, 1000);

<pre lang="JavaScript">function getIBtrade() {
           var id = document.getElementById("hdibid").value;
           //alert('Hi');
           $.ajax({
               type: "POST",
               url: "Home.aspx/GetData",
               data: "{IBid:" + parseInt(id) + "}",
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success: function (response) {

                   var list = document.getElementById("accordion");
                   list.innerHTML = response.d;
                   $("#accordion").accordion("destroy");
                   $("#accordion").accordion();
                   //alert('hii');


               }
           });


       }



What I have tried:

below Ajax method get dynamic Design using web method...html code and data both....please help me
Posted
Updated 8-Aug-16 4:43am
Comments
Krunal Rohit 6-Aug-16 7:28am    
Save the tab reference in LocalStorage and check this storage on Page Load.

KR
kaushik ahir 6-Aug-16 8:40am    
ok
how to active Spacific index wise tab open

1 solution

The documentation says that there is an active property that you can set. See here, Accordion Widget | jQuery UI API Documentation[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900