[Pro] One for Richard - Accordion menu script help

Hi Richard, I’m implementing the accordion menu, as discussed in this thread: Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk, into a new site I’ve just started on and again it works great, however as this site may be a long scrolling page with links to anchors up and down the page, is there something that I can add the the script that will cause the menu to close once the link has been clicked, so that when you scroll back to the top the menu is not still open?

Should there be some CSS involved too?

Here’s the script:

$(document).ready(function() {

$(‘.accordionButton’).click(function() {

$('.accordionButton').removeClass('on');

$('.accordionContent').slideUp('normal');

if($(this).next().is(':hidden') == true) {

    $(this).addClass('on');

    $(this).next().slideDown('normal');
 } 

});

$(‘.accordionContent’).hide();
});
Here’s the link to the test site:

Hope you can advise when you have some time.

Thanks Dave

http://www.stundesign.co.uk/miniscoff/index.html


freewaytalk mailing list
email@hidden
Update your subscriptions at: