Keeping Accordion Menu open when menu items area selected?

Keeping Accordion Menu open when menu items area selected?

Hey ladies and gents,

I wonder if anyone can help me, massive help if you can :)

I have created a jquery accordion menu for a brilliant CMS called 'Concrete5' and all works lovely BUT I now would like the menu to stay open if a menu item is selected within the drop list.

I have manged to create the following.....
  1. var pathname = window.location.pathname;
  2. var selecteda = $(".nav-selected a").attr("href");
  3.       // alert (selecteda)
  4.       // alert (pathname)
  5.       if ( selecteda == pathname ){
  6.             $('.nav-path-selected').parent().children().show();
  7.       } else {
  8.             $('#am_menu .nav-selected').hide();
  9.       }
  10. }
..but it doesn't seem to work :'(

I'm not a JQuery GOD like most of you on here but I am trying my hardest :D
The accordion menu I am trying to get this to happen on is Accordion Menu.

Any pointers or help is massively appreciated.
Thanks in advance, Chris

- Chris Watterston
- - Freelance Graphic & Web Design
- - - www.funkthemedia.com