我正在使用 jquery + css3 创建手风琴菜单一切正常期望菜单在页面加载时总是打开并且隐藏它的代码不起作用这是我创建的小提琴
这是我的jQuery代码
$(document).ready(function() {
//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
$('.zero_menu_title_collapse').click(function() {
//REMOVE THE ON CLASS FROM ALL BUTTONS
$('.zero_menu_title_collapse').removeClass('on');
//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
$('.zero_menu_content').slideUp('normal');
//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
if($(this).next().is(':hidden') == true) {
//ADD THE ON CLASS TO THE BUTTON
$(this).addClass('on');
//OPEN THE SLIDE
$(this).next().slideDown('normal');
}
});
/*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
//ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER
$('.').mouseover(function() {
$(this).addClass('over');
//ON MOUSEOUT REMOVE THE OVER CLASS
}).mouseout(function() {
$(this).removeClass('over');
});
/*** END REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
/********************************************************************************************************************
CLOSES ALL S ON PAGE LOAD
********************************************************************************************************************/
$('.zero_menu_content').hide();
});
这是完整的小提琴