title: JQuery - Remember open accordion state
body: <p>I currently have a jquery accordion that does exactly what I want, except for one thing. When I click on a link in the accordion panel to go to another page I would like the accordion to remain open at the same place (if possible) when I click the back button. The back button is an image that I've created and not the back button of the browser.</p>
  
  <p>This is my jquery script:</p>
  
  <pre><code>&lt;script&gt;
   $(function() {
      $(".jquery-ui-accordion").accordion({
          autoHeight: false,
          collapsible: true,
          heightStyle: "content",
          active: false,
          animate: 300 // collapse will take 300ms
      });
      $('.jquery-ui-accordion h3').bind('click',function(){
          var self = this;
          setTimeout(function() {
              theOffset = $(self).offset();
              $('body,html').animate({ scrollTop: theOffset.top - 100 });
          }, 310); // ensure the collapse animation is done
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>This is what's in my header:</p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>It opens and scrolls very nicely and if there's a long piece of text in a different accordion panel, the panel that was clicked on will jump into screen view.</p>
  
  <p>I don't want to alter what it does currently, I just want to be able to add a remember state when I click the back button image.</p>
  
  <p>I've read about <code>jquery</code> cookies but honestly would not even know where to start with that to include it.</p>
  
  <p>Any help would be greatly appreciated!</p>