$(".header").addclass("yanse"); $(".header").addclass("yanse01"); $(window).scroll(function(){ var scrolltop = $(this).scrolltop(); if($(this).scrolltop() ==0){ $(".header").addclass("yanse"); $(".header").addclass("yanse01"); }else{ $(".header").addclass("yanse"); $(".header").removeclass("yanse01"); } }); $(".icon_nav_item").click(function(){ if($(this).parent().hasclass("hover")){ $(this).parent().removeclass("hover"); $(this).parent().find(".subnav").stop().slidetoggle(); }else{ $(".menu .a").each(function(){ if($(this).hasclass("hover")){ $(this).removeclass("hover"); $(this).find(".subnav").stop().slidetoggle(); } }); $(this).parent().addclass("hover"); $(this).parent().find(".subnav").stop().slidetoggle(); } }); $(".menu_body").click(function(){ if($(this).hasclass("show")){ $(".menu").hide(); $(this).removeclass("show"); $("body").removeclass("menushow"); $(".menu").removeclass("show"); $(".header").removeclass("show"); }else{ $(".menu").show(); $(this).addclass("show"); $("body").addclass("menushow"); $(".menu").addclass("show"); $(".header").addclass("show"); } }); if($(window).width()>768){ $(".menu .hasmenu").hover(function() { //$(".menubg").stop(true, true).slidetoggle(500); }); }