/** * tabs * @return */ function tabs(tabTitle,tab_content,event){ var index=$(tabTitle).children(".hover").index() $(tab_content).children().eq(index).show().siblings().hide(); $(tabTitle).children().bind(event,function(){ var index=$(this).index(); $(this).addClass("hover").siblings().removeClass("hover"); $(tab_content).children().eq(index).show().siblings().hide(); return false; }); } /*选择框*/ function stopPropagation(event){ e=window.event||event; if(document.all){e.cancelBubble=true;}else{e.stopPropagation();e.stopImmediatePropagation();} } function select(demo){ $(demo).attr("val",0) $("body").on('click',demo,function(event){ var nowtext=$(this).find(".seljg").html().replace(/\s*/g,"") $(this).find(".selTj a").each(function(index, element) { var thishtml=$(this).html() if(thishtml===nowtext){$(this).addClass("hover").siblings().removeClass("hover")}}); var val=$(this).attr("val") if(val==0){$(this).find(".selTj").show().parents(demo).attr("val",1)}else{$(this).find(".selTj").hide().parents(demo).attr("val",0)} $(demo).not(this).attr("val",0) $(demo).not(this).find(".selTj").hide() //stopPropagation(event) return false; }) $("body").on("click",".selTj a",function(){ //$(".selTj a").click(function(){ var text=$(this).html() $(this).parents(demo).attr("val",0) $(this).parent().hide().siblings(".seljg").html(text).siblings("input").attr("value",text) //stopPropagation(event) return false; }) $(document).click(function(){ $(".selTj").hide() $(demo).attr("val",0) }) } /* *字体大小 */ $(function(){ var fontSize=$(".articleTime span") var articleBox=$(".articleBox") fontSize.click(function(){ $(this).addClass("hover").siblings().removeClass("hover") var fontHtml=$(this).html(); if(fontHtml=="小") { articleBox.css({"font-size":"12px"}) } else if((fontHtml=="中")) { articleBox.css({"font-size":"14px"}) } else if((fontHtml=="大")) { articleBox.css({"font-size":"18px"}) } }) }) //wow 同一行 元素延迟加载 function wowDelay(box,row,delayTime){ $(box).children().each(function(index){ for(var i = 0;ih){ $(".getHomeDiv").fadeIn(); }else{ $(".getHomeDiv").fadeOut(); } }); $(".getHome").click(function(){ $("html,body").stop(true,true).animate({scrollTop:0}) }); // if($(".column1Box").hasClass("column1Box")){ var pth=$(".column1Box").offset().top; $(".customer").css({"margin-top":0,"top":pth-177}); $(".floatR").css({"margin-top":0,"top":pth+187-177}); $(window).scroll(function(){ var h=$(window).height(); var pt=$(this).scrollTop(); if(pt>h/2){ $(".customer").css({"margin-top":"-115px","top":"50%"}); $(".floatR").css({"margin-top":"70px","top":"50%"}); }else{ $(".customer").css({"margin-top":0,"top":pth-177}); $(".floatR").css({"margin-top":0,"top":pth+187-177}); } }); }else if($(".location").hasClass("location")){ var pth=$(".location").offset().top; $(".customer").css({"margin-top":0,"top":pth}); $(".floatR").css({"margin-top":0,"top":pth+187}); $(window).scroll(function(){ var h=$(window).height(); var pt=$(this).scrollTop(); if(pt>h/2){ $(".customer").css({"margin-top":"-115px","top":"50%"}); $(".floatR").css({"margin-top":"70px","top":"50%"}); }else{ $(".customer").css({"margin-top":0,"top":pth}); $(".floatR").css({"margin-top":0,"top":pth+187}); } }); } //// //scaleImg(); }); $(window).resize(function(){ banner() }) /////// $(window).load(function(){ $(".menu dd").eq(1).find(".subMenuDiv").addClass("typ2"); $(".menu").menu({ type:0,//0--无滑块(默认);1--有滑块 startFun:function(i){//滑块进入后回调方法 $(".menu dd").eq(i).find(".subMenuDiv").stop(true,true).slideDown(); }, endFun:function(i){//滑块离开后回调方法 $(".menu dd").find(".subMenuDiv").stop(true,true).slideUp() } }); // $(".pdtBoxLDl").menu(); });