tags:

views:

9

answers:

0

I have links that are inside a jquery accordion on a page. When a visitor clicks on one of those links then hits the back button to return to my page, I'd like the accordion that contained the link to be open.

My assumption was that I should use the navigation:true setting and add hashtags to the different accordions, but that isn't working for me.

Here is what I have:

// lots of content above here // 

<div id="accordion">

<h5><a href="#area1">Area 1 header</a></h5>
<div>
    <ul>
        <li><a href='http://www.externalsite.com'&gt;Link to an external site</li>
    </ul>
</div>

<h5><a href="#area2">Area 2 header</a></h5>
<div>
    <ul>
        <li><a href='http://www.anotherexternalsite.com'&gt;Link to another external site</li>
    </ul>
</div>

// At the bottom of the page below the jquery and jquery ui references //

<script type="text/javascript">
    $(document).ready(function(){
       $("#accordion").accordion({active:false,collapsible:true,autoHeight:false,navigation:true});
    });
</script>

The accordion works just fine while I'm in the page. If I click one of the external links and then click the back button, all the accordions are collapsed. I think it will be a irritating experience for people to have to open the accordion they were previously on to click the next link - or read more about that area, which is why I'm trying to make this change.

Am I headed down the right road using the navigation option?