Accordion Nav Add-on Help

Permalink 1 user found helpful
I've been waiting for a response for awhile now and I've had no luck with the developer on this particular question. So, I thought I'd in the forums for some help.

I've purchased the Accordion Nav. add-on and have changed it from the standard hover effect to a click effect.

The problem I'm having is that when I click on a sub-nav (interior page) the accordion nav closes up after the page refreshes with the new page. Is there a way to keep the accordion nav open when its under a certain parent item? I have yet to figure this out.

bryanlewis
 
ScottC replied on at Permalink Reply
ScottC
yes, look at $c->getCollectionParentID();

if that matches with the parent page directly above that, apply a css class that makes that accordion thing open?
bryanlewis replied on at Permalink Reply
bryanlewis
This is what I have as of right now and what i've been working on. Right now its just showing the first ul all the time no matter what the parent id is. So I think i'm headed in the right direction. I'm not so sure on the js.


$parentIDopen = array( $c->getCollectionParentID() );
      if($parentIDopen != 1){ ?>
         <script type="text/javascript">function initMenu() { $('#am_menu ul').hide(); $('#am_menu ul:first').show(); $('#am_menu li a').show();}</script>
      <?php }
      else{ ?>
         <script type="text/javascript">function initMenu() { $('#am_menu ul').hide(); $('#am_menu ul:first').hide(); $('#am_menu li a').hide();}</script>
      <?php } 
      ?>
ScottC replied on at Permalink Best Answer Reply
ScottC
no,

assuming you want to leave open the parent page, you'd want to do $parentID = $c->getCollectionParentID();
if($parentID == $c->getCollectionID()) 'mark it as open'

your css selector seems very vague and thus not at all specific to anything i'd think would be distinguishable in an accordion, you need to set an id to target to open if your javascript in fact works.