首先我是一個完整的jQuery啓動,我需要的是修改腳本。現在我有子菜單,當我打開它並打開鏈接時,它崩潰了,我想要的是當我打開子菜單項鍊接時,子菜單仍然會在頁面實時打開時,是否有可能jquery垂直菜單崩潰isue
這裏是鏈接菜單腳本我使用http://thecodeplayer.com/walkthrough/vertical-accordion-menu-using-jquery-css3
/*jQuery time*/
$(document).ready(function(){
$("#accordian h3").click(function(){
//slide up all the link lists
$("#accordian ul ul").slideUp();
//slide down the link list below the h3 clicked - only if its closed
if(!$(this).next().is(":visible"))
{
$(this).next().slideDown();
}
})
})
和你的代碼是? – slash197
p.s 我嘗試了$(this).attr(「class」,「active」);但它只能工作,直到頁面刷新 – Raimonds
您需要使用Cookie來保持打開狀態。 [jquery-cookie](https://github.com/carhartl/jquery-cookie) – bitWorking