Reputation: 111
How are you. I'm building a content menu/accordion and I was having some trouble building out 3 segment of it.
1) Wanted When you click on button, to keep the previous menu open, menu should be closed manually and not automatically. Currently it automatically closes the previous.
2) A close All click link that closes all the menu
3) a Open all click link that opens all the menu
i Started a Fiddle
$('div.accordionButton').click(function() {
$('div.accordionContent').slideUp('normal');
$(this).next().slideDown('normal');
});
/*********
CLOSES ALL DIVS ON PAGE LOAD
*****/
$("div.accordionContent").hide();
Upvotes: 0
Views: 402
Reputation: 479
Looks like you just give a job. I mean that you actually do not know html/js well.
$('div.accordionButton').click(function() {
$(this).next().slideToggle('normal');
});
$('#hide-all').on('click',function(){
$('div.accordionContent').slideUp('normal');
});
$('#show-all').on('click',function(){
$('div.accordionContent').slideDown('normal');
});
Upvotes: 1