/** * tabs * @return */ function adddelay(){ $('.list-solo li').each(function(index, el) { $(this).attr('data-wow-delay', '0.'+index*2+"s"); }); $('.i-row4 .list-news li').each(function(index, el) { index+=1 $(this).attr('data-wow-delay', '0.'+index*2+"s"); }); $('.newsdl dd').each(function(index, el) { index+=1 $(this).attr('data-wow-delay', '0.'+index*2+"s"); }); } adddelay(); //wow 动画判断 if (! (/msie [6|7|8|9]/i.test(navigator.useragent))) { new wow().init(); }; var debounce = function(fn, delay) { var timeout; return function() { var self = this; var args = arguments; window.cleartimeout(timeout); timeout = window.settimeout(function() { fn.apply(self, args); }, delay); }; }; var scrolldown1 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row1-box').offset().top }, 800); },200); var scrolldown2 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.indnews').offset().top }, 800); },200); var scrollup1 = debounce(function(){ $('body, html').stop().animate({ scrolltop: 0 }, 800); },200); var scrollup2 = debounce(function(){ if( $('.i-row1').length <=0 ) return; $('body, html').stop().animate({ scrolltop: $('.i-row1').offset().top }, 800); },200); var scrolldownm1 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row1-box').offset().top -50 }, 800); },200); var scrolldownm2 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row2').offset().top - 50 }, 800); },200); var scrolldownm3 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row3').offset().top - 50 }, 800); },200); var scrolldownm4 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row4').offset().top - 50 }, 800); },200); var scrolldownm5 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $(document).height() }, 800); },200); var scrollupm1 = debounce(function(){ $('body, html').stop().animate({ scrolltop: 0 }, 800); },200); var scrollupm2 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row1-box').offset().top - 50 }, 800); },200); var scrollupm3 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row2').offset().top - 50 }, 800); },200); var scrollupm4 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row3').offset().top - 50 }, 800); },200); var scrollupm5 = debounce(function(){ $('body, html').stop().animate({ scrolltop: $('.i-row4').offset().top - 50 }, 800); },200); 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 tabsurl(tabsurlclass){ var title1tab=$(tabsurlclass).find("a") title1tab.hover(function(){ var url=$(this).attr("href") $(this).parent().siblings("div").find("a").attr("href",url) }) } $(document).ready(function(){ tabs("#tab1","#tab1c","hover"); tabs("#tab2","#tab2c","hover"); //导航 $(".menu_dl dd").addclass("hide"); $(".menu_dl dd").each(function(){ //动画延迟 $(this).find(".subnav_ul li").each(function(index){ $(this).css({ 'animation-delay':index*0.04+'s' }); }); var _this=$(this) if(_this.find(".subnav_ul li").length>0){ _this.hover(function(){ $(".menu_dl dd.hover").removeclass("hover").addclass("bj") _this.addclass("hover").removeclass("hide"); var thisleft=_this.position().left //console.log(_this.position().left) $(".menubg").show() //_this.find(".subnav_ul_box").show() var submenuw=_this.find(".subnav_ul").width() _this.find(".subnav_ul").parent().width(submenuw) var wrapw=$(".menubox").width() if((thisleft+submenuw)>wrapw){ _this.find(".subnav_ul_box").css({ right:0 }) }else{ _this.find(".subnav_ul_box").css({ left:0 }) } },function(){ _this.removeclass("hover").addclass("hide") $(".menu_dl dd.bj").removeclass("bj").addclass("hover") //_this.find(".subnav_ul_box").hide() $(".menubg").hide() }) } }) var lilg=$(".aboutbox2slide .hd ul li").length,a=0,ulw=0; $(".aboutbox2slide .hd ul").width(138*lilg); $(".aboutbox2slide").slide({ titcell:".hd ul li", maincell: ".bd dl", autopage:false, autoplay:false, //自动播放 effect:"left", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 3000, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", //scroll:2, vis:1, startfun:function(i){ var xl=i*138; if(xl>3*138&&xl<(lilg-4)*138){ $(".aboutbox2slide .hd ul").stop(true,false).animate({left:-xl+3*138}); }else if(i<5){ $(".aboutbox2slide .hd ul").stop(true,false).animate({left:0}); }; if(i>=(lilg-4)&&ulw>1110){ $(".aboutbox2slide .hd ul").stop(true,false).animate({left:-(lilg-8)*138}); }; $(".aboutbox2slide .bd dl dd").eq(i).find(".aboutbox2slide2").stop(true,true).fadein(1500); $(".aboutbox2slide .bd dl dd").eq(i).siblings().find(".aboutbox2slide2").stop(true,true).fadeout(); } }); // if(lilg>0){ ulw=$(".aboutbox2slide .hd ul").width(); }; if(ulw<1110){ $(".aboutbox2slide .hd ul").css({paddingleft:(1110-ulw),marginleft:-(1110-ulw)/2,paddingright:(1110-ulw),marginright:-(1110-ulw)}); $(".aboutbox2slide .hd ul").append('
  • ') }; //// $(".aboutbox2slide2").each(function(){ var _this=$(this); if($(this).find('.bd2 ul li').length>2){ $(this).slide({ titcell:".hd ul", maincell: ".bd2 ul", autopage:true, autoplay:true, //自动播放 effect:"toploop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 3000, //切换间隔 trigger: "click", prevcell: ".prev2", nextcell: ".next2", //scroll:2, vis:3, startfun:function(i){ _this.find(".bd2 ul li").eq(i+1).addclass("hover"); _this.find(".bd2 ul li").eq(i+1).siblings().removeclass("hover"); var imgsrc=_this.find(".bd2 ul li").eq(i+1).attr("dirimg"); var href=_this.find(".bd2 ul li").eq(i+1).find("a").attr("href"); _this.find(".piclbox").find("a img").attr("src",imgsrc); _this.find(".piclbox").find("a").attr("href",href); } }) $(this).find('.btbox .bt2').css('display','block'); }else{ //初始化 $(this).find(".bd2 ul li").eq(0).addclass("hover"); var imgsrc=_this.find(".bd2 ul li").eq(0).attr("dirimg"); var href=_this.find(".bd2 ul li").eq(0).find("a").attr("href"); $(this).find(".piclbox").find("a img").attr("src",imgsrc); $(this).find(".piclbox").find("a").attr("href",href); //鼠标感应 $(this).find(".bd2 ul li").hover(function(){ $(this).addclass("hover").siblings().removeclass('hover'); var imgsrc=$(this).attr("dirimg"); var href=$(this).find("a").attr("href"); $(this).parents('.aboutbox2slide2').find(".piclbox").find("a img").attr("src",imgsrc); $(this).parents('.aboutbox2slide2').find(".piclbox").find("a").attr("href",href); },function(){}); } }); //团队精英 if($('.aboutbox3slide .bd dl dd').length>1){ $(".aboutbox3slide").slide({ titcell:".hd ul", maincell: ".bd dl", autopage:true, autoplay:false, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 3000, //切换间隔 trigger: "click", prevcell: ".prev", nextcell: ".next", vis:3, }); $('.aboutbox3slide .bt').css({'display':'block'}); }; }) /* *字体大小+打印 */ $(function(){ //字体 $(".fontbt span").click(function(){ //获取para的字体大小 var thisele = $(".articlebox p,.articlebox,.articlebox font,.articlebox span,.articlebox div").css("font-size"); //parsefloat的第二个参数表示转化的进制,10就表示转为10进制 var textfontsize = parsefloat(thisele , 10); //javascript自带方法 var unit = thisele.slice(-2); //获取单位 var cname = $(this).attr("class"); if(cname == "bigger"){ if( textfontsize <= 22 ){ textfontsize += 2; } }else if(cname == "smaller"){ textfontsize -= 2; } //设置para的字体大小 $(".articlebox p,.articlebox,.articlebox font,.articlebox span,.articlebox div").css("font-size", textfontsize + unit ); $(".fontbt .medium").click(function(){ $(".articlebox p,.articlebox,.articlebox font,.articlebox span,.articlebox div").css("font-size","16px"); }) }); //打印 var printareacount = 0; $.fn.printarea = function () { var ele = $(this); var idprefix = "printarea_"; removeprintarea(idprefix + printareacount); printareacount++; var iframeid = idprefix + printareacount; var iframestyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; iframe = document.createelement('iframe'); $(iframe).attr({ style: iframestyle, id: iframeid }); document.body.appendchild(iframe); var doc = iframe.contentwindow.document; $(document).find("link").filter(function () { return $(this).attr("rel").tolowercase() == "stylesheet"; }).each( function () { doc.write(''); }); doc.write('
    ' + $(ele).html() + '
    '); doc.close(); var framewindow = iframe.contentwindow; framewindow.close(); framewindow.focus(); framewindow.print(); } var removeprintarea = function (id) { $("iframe#" + id).remove(); }; //打印调用 $(".btnprint").click(function(){$("#print").printarea();}); })