You can use the ontoggle event handler of the script to detect whenever a content has been expanded, then based on the ID of that content to reference the anchor link that toggled it. Then, add a class of "selected" to it to persist the hover state style while removing any selected class that may have been added to its peer anchor links previously. With all that in mind, do the following:
1) Extend your CSS to include a selected class:
Code:
#subheader a:hover, #subheader a.selected{border:1px solid #2A3791;}
2) Then, extend the initialization code for Animated DIV with the parts in red:
Code:
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
if (state=="block"){
var $anchor=$navlinks.filter('a[rel="toggle[' + divobj.id +']"]') //find link that toggled expanded content within nav UL
if ($anchor.length==1){
$navlinks.removeClass('selected')
$anchor.addClass('selected')
}
}
}
jQuery(function($){
$navlinks=$('ul#navileft li a[rel]') //reference links within navileft
})
animatedcollapse.init()
That should do it.
Bookmarks