/** * 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; }); } /** * tabs * @return */ function tabs2(tabtitle,tab_content,event){ var index=$(tabtitle).children(".hover").index() $(tab_content).children().eq(index).addclass("show").siblings().removeclass("hide"); $(tabtitle).children().bind(event,function(){ var index=$(this).index(); $(this).addclass("hover").siblings().removeclass("hover"); $(tab_content).children().eq(index).addclass("show").siblings().removeclass("show"); return false; }); } /* *字体大小 */ $(function(){ var fontsize=$(".article_time span") var articlebox=$(".article") 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"}) } }) }) /*选择框*/ function selected(selectdiv){ $(selectdiv).attr("val","0") $(selectdiv).find(".seljg,i").click(function(){ $(selectdiv).css("zindex","0") var val=$(this).parent().attr("val") var nowtext=$(this).parent().find(".seljg").text().replace(/\s*/g,""); $(this).siblings(".seltj").find("a").each(function(index, element) { var seltext=$(this).text() if(seltext == nowtext){ $(this).addclass("hover") } }); //判断当前这个点击其他的隐藏 $(document).find(".seltj").hide(); //下面这个if判断以单击写双击 if(val==1){ $(this).siblings(".seltj").hide() $(this).parent().attr("val","0") $(this).parent().css("zindex","0") }else{ $(selectdiv).attr("val","0") $(this).siblings(".seltj").slidedown("fast"); $(this).parent().css("zindex","999999999999999999") $(this).parent().attr("val","1")/*.siblings().attr("val","0")*/ } }) //下面这段实现点击外层隐藏下拉 $(".seltj a").click(function(){ var selecttext=$(this).text() $(this).addclass("hover").siblings().removeclass("hover") $(this).parent().siblings(".seljg").text(selecttext) $(this).parent().siblings("input").attr("value",selecttext) $(this).parent().css("display","none") $(this).parents(selectdiv).attr("val","0") }) $(document).click(function(){ $(selectdiv).find(".seltj").hide(); $(selectdiv).attr("val","0"); $(selectdiv).css("zindex","0") ; }) $(selectdiv).click(function(event) { event.stoppropagation(); //阻止事件向上冒泡 event.stopimmediatepropagation(); }); } $(document).ready(function() { //内页导航 $(".menudl dd").each(function(index, element) { $(this).hover(function(){ $(".menudl dd.hover").addclass("active").removeclass("hover"); $(this).addclass("hover"); $(this).find(".div_a").stop(true,true).slidedown(); },function(){ $(this).removeclass("hover"); $(".menudl dd.active").addclass("hover").removeclass("active"); $(this).find(".div_a").stop(true,true).slideup(); }) }); //banner $(".banner").slide({ titcell: ".hd ul", maincell: ".bd dl", autoplay:true, //自动播放 effect:"fold", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 2000, //切换时间 intertime: 5000, //切换间隔 autopage: true, //自动分页 //trigger: "click", prevcell: ".prev", nextcell: ".next" }); // $(".announcementslide").slide({ titcell:".hd ul", maincell: ".bd dl", autopage:true, autoplay:true, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 4000, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", //scroll:2, vis:2 }); $(".h_457l").slide({ titcell:".hd ul", maincell: ".bd dl", autopage:true, autoplay:true, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 3000, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", //scroll:2, vis:1, startfun:function(i){ var tt=$(".h_457l .bd dl dd").eq(i+1).attr("dir"); $(".h_457lt").text(tt); } }); $(".h_786lslide").each(function(){ var nn=$(this).find(".bd dl dd").length; if(nn<2){ $(this).find(".bt").hide() } }); var tt111=$(".h_786lslide1 .bd dl dd").eq(0).attr("dir"); $(".h_786lslidet.t1").text(tt111); $(".h_786lslide1").slide({ titcell:".hd ul", maincell: ".bd dl", autopage:true, autoplay:true, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 3500, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", //scroll:2, vis:2, startfun:function(i){ var tt=$(".h_786lslide1 .bd dl dd").eq(i+1).attr("dir"); $(".h_786lslidet.t1").text(tt); } }); $(".h_786lslide2").slide({ titcell:".hd ul", maincell: ".bd dl", autopage:true, autoplay:true, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 4000, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", //scroll:2, vis:2, startfun:function(i){ var tt=$(".h_786lslide2 .bd dl dd").eq(i+1).attr("dir"); $(".h_786lslidet.t2").text(tt); } }); //地图 $(".h_786maplist a").each(function(index){ $(this).hover(function(){ $(this).addclass("hover").siblings().removeclass("hover"); $(".map_dq img").eq(index).addclass("hover").siblings().removeclass("hover"); }); if($(this).hasclass("hover")){ $(".map_dq img").eq(index).addclass("hover").siblings().removeclass("hover"); } }); $(".imgmap area").each(function(index){ $(this).hover(function(){ $(".map_dq img").eq(index).addclass("hover").siblings().removeclass("hover"); $(".h_786maplist a").eq(index).addclass("hover").siblings().removeclass("hover"); }); }); $(".h_786map .imgbg").hover(function(){ $(".map_dq img.imgxny").addclass("hover").siblings().removeclass("hover"); $(".h_786maplist a.xny").addclass("hover").siblings().removeclass("hover"); }); // $(".h_695slide").each(function(index){ var aa=$(this).find(".bd dl dd").length; if(aa<4){ $(this).find(".bt").addclass("nnn"); } $(this).slide({ titcell:".hd ul", maincell: ".bd dl", autopage:true, autoplay:true, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 4000, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", vis:4 }); }) // tabs(".tab1",".tab1c","hover"); // $(window).scroll(function(){ var hh=$(window).height(); var sch=$(document).scrolltop(); if(sch>=hh+0.5*hh){ $(".gettop").stop(true,true).fadein(); } else{ $(".gettop").stop(true,true).fadeout(); } }); $(".gettop").click(function(){ $("html,body").stop(true,true).animate({scrolltop:0}); }); $(".wrap").addclass("wow fadeinup") $(".headbox1 .wrap,.headbox2 .wrap").removeclass("wow fadeinup") }); $(window).resize(function(){ }); $(window).load(function(){ });