jQuery if li a hasClass
<p>I have a show/hide menu built. Which works great. But by default the menu is closed, again this is fine until the page is navigated to.</p>

<p>When the page is navigated to the a anchor is built with the class of "active", What I would like to is check if "active" exsists with the menu and display that block based on that. So at least one menu is always open.</p>

<p>My current jQuery is as follows :</p>

<pre><code>    $('.sub_menu').hide();
$('.clickable').toggle(function(){
    $(this).next('ul').slideToggle();
    $(this).css('background-position','0px -12px');
}, function()
{
    $(this).next('ul').slideToggle();
    $(this).css('background-position','0px 5px');       
});

if ($('ul.sub_menu li a').hasClass('active')) {
    $(this).css('display','block');
}
</code></pre>

<p>I have also made a <a href="http://jsfiddle.net/Gs2vS/" rel="nofollow">jsFiddle</a></p>

<p>So I am targetting if the ul.sub_menu li a = active and if it is show the sub_menu. </p>

<p>But not having any luck with it. Thanks in advance</p>
