$(function(){ //获取浏览器宽度 var _width = $(window).width(); if(_width < 1200){ $(".header_menu").click(function(){ $(".showbox").animate({"right":"0px"},300); }); $(".showbox .close_bar a").click(function(){ $(".showbox").animate({"right":"-100%"},300); }); } else{ } $(".sbtn").click(function(){ $(".search").stop(true,true).slidetoggle(); }); $(".nav li").hover(function(){ $(this).find(".subnav").stop(true,true).slidetoggle(); }) }) $(function(){ $(".slidetxt").slide({trigger:"click"}); $(".slidetxt2").slide({trigger:"mouseover"}); //获取浏览器宽度 var _width = $(window).width(); if(_width < 800){ //直接为该div添加w1024样式,会覆盖前一个样式 $(".left").addclass("meunbtn"); $(".meunbtn .subname").click(function(){ $(".menulist").slidetoggle(); }) } else{ } $('.zjselectbox').each(function(i) { var _this=$(this); var spantxt=_this.find('.zjselecttxt span').text(); _this.find('.zjselecttxt').click(function(enevt) { $('.zjselectbox').not( $('.zjselectbox').eq(i) ).find('.zjselectul').stop(true).slideup(); _this.find('.zjselectul').stop(true).slidetoggle(); $(this).find('.icon').toggleclass('iconon'); $('.zjselectbox').not( $('.zjselectbox').eq(i) ).find('.icon').removeclass('iconon'); enevt.stoppropagation(); }); _this.find('.zjselectulbox ul li').click(function(enevt){ _this.find('.zjselecttxt span').text( $(this).text() ); _this.find('.zjselectul').stop(true).slideup(); $('.zjselectbox .icon').removeclass('iconon'); enevt.stoppropagation(); }); }); }); $(function(){ $(".single img").removeattr("height"); $(".single img").parent("p").removeattr("style"); $(".single img").parent("p").css("text-indent","0em"); })