hello B
hello B

Reputation: 963

How can I put scrollbar into accordion menu in jQuery

i'building an accordion menu:

$(document).ready(function(){

  /* Cambiare l'effetto da utilizzare */
  $.easing.def = "easeOutBounce";

  /* Associare una funzione all'evento click sul link */
  $('li.title a').click(function(e){

    /* Finding the drop down list that corresponds to the current section: */
    var subMenu = $(this).parent().next();

    /* Trovare il sotto menu che corrisponde alla voce cliccata */
    $('.sub-menu').not(subMenu).slideUp('slow');
    subMenu.stop(false,true).slideToggle('slow');

    /* Prevenire l'evento predefinito (che sarebbe di seguire il collegamento) */
    e.preventDefault();
  })

});

does anybody know how can I put a scroll bar into a accordion menu? Thanx!

Upvotes: 0

Views: 2442

Answers (1)

Trufa
Trufa

Reputation: 40737

Working example here.

The code:

You just need a normal accordion and set the overflow property and height in this example:

p{
    height:80px;
    overflow-y:scroll;
}

Upvotes: 2

Related Questions