2012-12-13 20 views
0

i'building手風琴菜單:我怎樣才能把滾動條到摺疊式菜單中的jQuery

$(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(); 
    }) 

}); 

有誰知道我怎樣才能把滾動條到手風琴菜單? Thanx!

+0

@Ladineko對於後來找到答案的人來說。也因爲你會在這個過程中學習第三,因爲無論如何你都可以通過選票獲得積分。 – Trufa

+0

好!現在我明白了! –

+0

@BrunoFerreira請不要隨意接受答案以提高您的分數,請花些時間並確定答案是正確的。 – Trufa

回答

2

工作示例here

代碼:

你只需要一個正常的手風琴和設置overflow屬性和高度在這個例子:因爲答案不僅是OP但

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