Use JQuery to keep active sub-navigation open when loading a new page
<p>I have built a sidebar navigation that collapses &amp; expands when the nav titles are clicked. this all works great. however, if i expand / open one of the nav groups and click to go to a page, when the new page loads all the nav groups start out closed again. I would love to find a way for the active nav group to stay open.</p>

<p>Here is what I've used for the collapse / expand:
(it's currently set up so that only one of the nav groups will be open at a time)</p>

<pre><code>/* Collapse and Expand */
$(".slideTitle").click(function() {
    $(".indexListOpen").removeClass("indexListOpen").addClass("indexList");
    $(this).next().toggleClass("indexList").toggleClass("indexListOpen");
});
</code></pre>

<p>And this is what I was trying to use to keep the current nav group open when the new page loads:</p>

<pre><code>/* keep current nav group open */
var path = location.pathname;
$('.indexListOpen a[@href$="' + path + '"]').addClass("selected");
$(".selected").parent().parent().removeClass("indexList").addClass("indexListOpen");
</code></pre>

<p>Not working ... so I'm sure I'm doing plenty wrong.
The page I am working on is located at instarservices.com/commercial</p>

<p>Any help is appreciated!!!</p>
