/* jQuery jtClite beta_v0.1 */ //alert('dfdf'); /*.scoll_box>>>.s_box>>>.s_con至少需要三级目录*/ (function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery); /*promo*/ (function(a){a.fn.extend({bannerbox_thaw:function(b){b=a.extend({thumbObj:null,botPrev:null,botNext:null,thumbNowClass:"hover",thumbOverEvent:true,slideTime:1000,autoChange:true,clickFalse:true,overStop:true,changeTime:5000,delayTime:300},b||{});var h=a(this);var i;var k=h.size();var e=0;var g;var c;var f;function d(){if(e!=g){if(b.thumbObj!=null){a(b.thumbObj).removeClass(b.thumbNowClass).eq(g).addClass(b.thumbNowClass)}if(b.slideTime<=0){h.eq(e).hide();h.eq(g).show()}else{h.eq(e).fadeOut(b.slideTime);h.eq(g).fadeIn(b.slideTime)}e=g;if(b.autoChange==true){clearInterval(c);c=setInterval(j,b.changeTime)}}}function j(){g=(e+1)%k;d()}h.hide().eq(0).show();if(b.thumbObj!=null){i=a(b.thumbObj);i.removeClass(b.thumbNowClass).eq(0).addClass(b.thumbNowClass);i.click(function(){g=i.index(a(this));d();if(b.clickFalse==true){return false}});if(b.thumbOverEvent==true){i.mouseenter(function(){g=i.index(a(this));f=setTimeout(d,b.delayTime)});i.mouseleave(function(){clearTimeout(f)})}}if(b.botNext!=null){a(b.botNext).click(function(){if(h.queue().length<1){j()}return false})}if(b.botPrev!=null){a(b.botPrev).click(function(){if(h.queue().length<1){g=(e+k-1)%k;d()}return false})}if(b.autoChange==true){c=setInterval(j,b.changeTime);if(b.overStop==true){h.mouseenter(function(){clearInterval(c)});h.mouseleave(function(){c=setInterval(j,b.changeTime)})}}}})})(jQuery); $(function(){ $(".navli").mouseover( function(){ $ins=$(this).children('.downul'); $(this).addClass("navlihover").siblings().removeClass('navlihover'); $ins.show(); }); $(".navli").mouseout( function(){ $ins=$(this).children('.downul'); $ins.hide(); }); var scoll_nav_li = $('.scoll_nav li');//切换加滚动样式 scoll_nav_li.mouseover(function(){ $(this).addClass('selected') .siblings().removeClass('selected'); var scoll_nav_li_index = scoll_nav_li.index(this); $('.scoll_switch .scoll_box').eq(scoll_nav_li_index).addClass('selected') .siblings().removeClass('selected'); }); var disa_li = $('.disa_li li');//切换加滚动样式 disa_li.mouseover(function(){ $(this).addClass('selected') .siblings().removeClass('selected'); var disa_li_index = disa_li.index(this); $('.disa_switch .disa_box').eq(disa_li_index).addClass('selected') .siblings().removeClass('selected'); }); //小类文章 var sdisa_li = $('.sdisa_li li');//切换加滚动样式 sdisa_li.mouseover(function(){ $(this).addClass('selected') .siblings().removeClass('selected'); var sdisa_li_index = sdisa_li.index(this); $('.sdisa_switch .sdisa_box').eq(sdisa_li_index).addClass('selected') .siblings().removeClass('selected'); }); //专家团队 var tab_nav_li = $('.new_tab_nav li');//切换样式 $('.new_tab_switch>.tabcon').eq(0).show(); $('.new_tab_switch div.tabcon:not(:eq(0))').hide(); var Top = $(".new_tab_switch").offset().top; tab_nav_li.click(function(){ var This = $('.new_tab_nav li').index(this); $("body,html").animate({scrollTop:Top - 44},500); $(".new_tab_switch .tabcon:eq("+ This +")").css({display:'block'}) $(".new_tab_switch .tabcon:not(:eq("+ This +"))").css({display:'none'}) }); var tab_nav_li = $('.tab_nav li');//切换样式 tab_nav_li.mouseover(function(){ $(this).addClass('selected') .siblings().removeClass('selected'); var tab_nav_li_index = tab_nav_li.index(this); $('.tab_switch>.tabcon').eq(tab_nav_li_index).show() .siblings().hide(); }).hover(function(){ $(this).addClass(''); },function(){ $(this).removeClass(''); }); var tab_menu_li = $('.hmlflist dl');//高亮当前选项 tab_menu_li.mouseover(function(){ $(this).addClass('selected') .siblings().removeClass('selected'); }); $(".link3 .scoll").jCarouselLite({//滚动控制 visible: 6, scroll: 1, auto: 1200, speed: 1200 }); $(".link4 .scoll").jCarouselLite({//滚动控制 visible: 6, scroll: 1, auto: 1200, speed: 1200 }); $(".bzzt .scoll").jCarouselLite({//滚动控制 visible: 1, scroll: 1, auto: 1200, speed: 1200 }); $(".rightzt .scoll").jCarouselLite({//滚动控制 visible: 1, scroll: 1, auto: 1200, speed: 1200 }); $(".zjgd .scoll").jCarouselLite({//滚动控制 btnNext: ".zjgd .next", btnPrev: ".zjgd .prev", visible: 1, scroll: 1, auto: true, speed: 1200 }); $(".hban .scoll").jCarouselLite({//滚动控制 btnNext: ".hban .next", btnPrev: ".hban .prev", visible: 1, scroll: 1, auto: true, speed: 2500 }); $(".ghmd .scoll").jCarouselLite({//滚动控制 btnNext: ".ghmd .next", btnPrev: ".ghmd .prev", visible: 8, scroll: 1, vertical:true, auto: true, speed: 1200 }); $(".jblf .scoll").jCarouselLite({//滚动控制 btnNext: ".jblf .next", btnPrev: ".jblf .prev", visible: 2, scroll: 1, auto: true, speed: 1200 }); var tab_menu_li = $('.righttsjs dl');//高亮当前选项 tab_menu_li.mouseover(function(){ $(this).addClass('selected') .siblings().removeClass('selected'); }); //================= position(); window.onresize=position; //=================== $('#w2').mouseover(function(){ $('#w2 span').show(); }); $('#w2').mouseout(function(){ $('#w2 span').hide(); }); //自定义变量 var warp = $("#env").width(); var case_len = $("#env dl dd").length; //alert(case_len) var case_int = true; var case_index = 0; //左右按钮切换 $(".hjbig span.fl img").click(function(){ case_index-=1; if(case_index == -1){ case_index = case_len - 1; } clearInterval(case_int) case_focus(case_index) case_setInterval(case_index) }) $(".hjbig span.fr img").click(function(){ case_index+=1; if(case_index == case_len){ case_index = 0; } clearInterval(case_int) case_focus(case_index) case_setInterval(case_index) }) //鼠标经过小图切换 $("#env_small dl").click(function(){ case_index = $("#env_small dl").index(this); clearInterval(case_int) case_focus(case_index) case_setInterval(case_index) }) //自动切换效果 function case_setInterval(case_index){ case_int = setInterval(function(){ case_index++; if(case_index == case_len){ case_index = 0; } case_focus(case_index) },4000) } case_setInterval(case_index) //$("#case_pic ul li").stop(true,false).removeClass("case_li").eq(0).addClass("case_li").stop(true,false); //切换函数 function case_focus(case_index){ $("#env dl").animate({left:-case_index * warp}); //$("#case_pic ul li").stop(true,false).removeClass("case_li").eq(case_index).addClass("case_li").stop(true,false); } //case_focus(); //====================================== $(".dropDown").each(function(_select){ var putIn_on = $('.dropDown:eq("+_select +") small:first').html(); $(".dropDown:eq("+ _select +") font").val(putIn_on); $(".dropDown:eq("+ _select +")").hover(function() { $(".dropDown:eq("+ _select +") small").show(); },function(){ $(".dropDown:eq("+ _select +") small").hide(); }); $(".dropDown:eq("+ _select +") small").click(function() { var listText = $(this).html(); $(".dropDown:eq("+ _select +") .putIn").val(listText); $(".dropDown:eq("+ _select +") small").hide(); }); }) }); //首页专家团队 $(function(){ var team_width = $("#team_focus div.bigzj1").width()+18; var team_len = $("#team_focus div.zjbg").length; //alert(team_len) var index = 0; var int; //自动切换 function _setInterval(){ int = setInterval(function(){ index++; if(index == team_len){ index = 0; } team_focus() },5000) } //调用函数 _setInterval() //鼠标经过大图悬停 $("#team_focus div.zjbg").hover(function(){ clearInterval(int) },function(){ _setInterval() }) //鼠标经过小图悬停 $("#team li").hover(function() { index = $("#team li").index(this); team_focus(); clearInterval(int) },function(){ _setInterval() }) //设置第一个默认 LI $("#team li:eq(0) a p,#team li:eq(0) a font").css({top:'104px'}) //效果函数 function team_focus(){ $("#team_focus").animate({"left":-(team_width*index)},300); $("#team li").find("a p").animate({top:'131px'},200).eq(index).stop().animate({top:'104px'},200); $("#team li").find("a font").animate({top:'131px'},200).eq(index).stop().animate({top:'104px'},200); } }) //右侧专家自动切换 $(function(){ var right_len = $(".zjtj dl dd").length; var right_big_width = $(".zjtj dl dd").width(); var right_small_width = $("#right_small_expert ul li").width()+5; var right_small_focus_width = right_len - 3; var num = 0; var setint=true; //alert(right_len) //自动切换 function right_setInterval(){ setint = setInterval(function(){ num++; if(num == right_len){ num = 0; } right_focus(); },3000) } right_setInterval() //鼠标经过大图悬停 $(".zjtj dl dd").hover(function(){ clearInterval(setint) },function(){ right_setInterval(); }) //鼠标经过小图悬停 $("#right_small_expert ul li").hover(function(){ //鼠标经过切换对应专家 num = $("#right_small_expert ul li").index(this); $(".rightzj .zjtj dl").animate({left:-(right_big_width*num)}) clearInterval(setint) },function(){ right_setInterval(); }) //左右按钮点击切换 $("#right_expert_prev").click(function(){ num-=1; if(num == -1){ num = right_len - 1; } //alert(num) right_focus(); clearInterval(setint) right_setInterval() }) $("#right_expert_next").click(function(){ num+=1; if(num == right_len){ num = 0; } right_focus(); clearInterval(setint) right_setInterval() }) function right_focus(){ $(".rightzj .zjtj dl").animate({left:-(right_big_width*num)}) //alert(right_small_width*5) if(num == right_small_focus_width || num == (right_small_focus_width + 1) || num == (right_small_focus_width + 2) || num == (right_len - 1)){ //alert(num == right_small_focus_width) $("#right_small_expert ul").animate({left:-(right_small_width*right_small_focus_width)}) }else if(num == 0){ //alert(num == 0) $("#right_small_expert ul").animate({left:-(right_small_width*num)}) }else{ $("#right_small_expert ul").animate({left:-(right_small_width*num)}) } } }) //bannerbox切换 var sWidth = $(document).width(); //alert(sWidth) var len = $(".bannerbox ul li").length; var index = 0; var picTimer; $(".bannerbox .btnBg").css("opacity",0.5); $(".preNext").hide(); $(".bannerbox").mousemove(function(){ $(".preNext").show(); }); $(".bannerbox").mouseleave(function(){ $(".preNext").hide(); }); $(".bannerbox .btn span").mouseenter(function() { index = $(".bannerbox .btn span").index(this); showPics(index); }).eq(0).trigger("mouseenter"); $(".bannerbox .preNext").css("opacity",0.2).hover(function() { $(this).stop(true,false).animate({"opacity":"0.5"},300); },function() { $(this).stop(true,false).animate({"opacity":"0.2"},300); }); $(".bannerbox .pre").click(function() { index -= 1; if(index == -1) {index = len - 1;} showPics(index); }); $(".bannerbox .next").click(function() { index += 1; if(index == len) {index = 0;} showPics(index); }); $(".bannerbox ul").css("width",sWidth * (len)); $(".bannerbox li").css("width",sWidth); $(".bannerbox").hover(function() { clearInterval(picTimer); },function() { picTimer = setInterval(function() { showPics(index); index++; if(index == len) {index = 0;} },4000); }).trigger("mouseleave"); function showPics(index) { var nowLeft = -index*sWidth; $(".bannerbox ul").stop(true,false).animate({"left":nowLeft},300); $(".bannerbox .btn span").removeClass("on").eq(index).addClass("on"); } //公共右侧先是隐藏 function position(){ //变量 var p_width = $(window).width(); //alert(p_width) if(p_width <= 1024){ $(".jsright").css({display:'none'}) }else{ $(".jsright").css({display:'block'}) } function bannerbox_focus(){ } } //$(".nav ul.f14 li:eq(4)").hide(); $(function(){ $(".new_nav dl dd a img").each(function(new_nav){ $(this).hover(function(){ //alert(true) $(".new_nav dl dd a img:eq("+ new_nav +")").attr("src","/images/new_nav_hover_img"+ (new_nav+1) +".jpg") },function(){ $(".new_nav dl dd a img:eq("+ new_nav +")").attr("src","/images/new_nav_link_img"+ (new_nav+1) +".jpg") }) }); //$(".bottom .bottom_nav a:eq(4)").hide(); })