user1214467
user1214467

Reputation: 111

Slider Menu Open Close Issues/ Jquery

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

http://jsfiddle.net/XUEFx/1/

$('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

Answers (1)

Novelist
Novelist

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');
});

http://jsfiddle.net/XUEFx/2/

Upvotes: 1

Related Questions