title: Jquery Accordion, keep open selected on Refresh / Page Change
body: <p>I try this code for my jquery Accordion</p>
  
  <pre><code>        (function(jQuery){
           jQuery.fn.extend({  
               accordion: function() {       
                  return this.each(function() {
  
                      var $ul = $(this);
  
                      if($ul.data('accordiated'))
                          return false;
  
                      $.each($ul.find('ul, li&gt;div'), function(){
                          $(this).data('accordiated', true);
                          $(this).hide();
                      });
  
                      $.each($ul.find('a'), function(){
                          $(this).click(function(e){
                              activate(this);
                              //alert(this);
                              return void(0);
                          });
                      });
                      var sPath = window.location.pathname;
                      var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
                      var findvar=sPage;
                      var active = (findvar)?$(this).find('a[href='+ findvar + ']')[0]:'';
  
                      if(active){
                          activate(active, 'toggle');
                          $(active).parents().show();
                      }
  
                      function activate(el,effect){
                          $(el).parent('li').toggleClass('active').siblings().removeClass('active').children('ul, div').slideUp('fast');
                          $(el).siblings('ul, div')[(effect || 'slideToggle')]((!effect)?'fast':null);
                      }
  
                  });
              } 
          }); 
      })(jQuery);
  </code></pre>
  
  <p>But when i refresh page, all Accordion collapse.
  But I want that when I refresh page. Keep selected Accordion open,  because my Accordion is Side navigation placed in Include (php). so one php file for all side Accordion navigation, So whenever I clicked on menu, page should be change and keep selected Accordion open.</p>