jquery(document).ready(function($){ $('#slider').flexslider({ selector: ".slides > li", animation: "fade", controlnav: true, multiplekeyboard:true, pauseonaction: true, animationloop: true, directionnav: false, slideshow: true, slideshowspeed: 3500, easing:"swing", smoothheight: false, pauseonhover:true }); $('.slider_x4').flexslider({ selector: ".sliders > li", animation: "slide", controlnav: false, animationloop: true, slideshowspeed: 3000, itemwidth: 310, maxitems: 4, itemmargin:20 }); $('.slider_x4_2').flexslider({ selector: ".sliders > li", animation: "slide", controlnav: false, animationloop: true, slideshowspeed: 3000, itemwidth: 310, maxitems: 4, itemmargin:20 }); $('.slider_x6').flexslider({ selector: ".sliders > li", animation: "slide", controlnav: false, animationloop: true, slideshowspeed: 3000, itemwidth: 209.167, maxitems: 6, itemmargin:9 }); $('.slider_x7').flexslider({ selector: ".sliders > li", animation: "slide", controlnav: false, animationloop: true, slideshowspeed: 3000, itemwidth: 177.143, maxitems: 7, itemmargin:10 }); $(".col-2 li:nth-child(2n+2),.col-3 li:nth-child(3n+3),.col-4 li:nth-child(4n+4),.col-5 li:nth-child(5n+5),.col-6 li:nth-child(6n+6),.col-7 li:nth-child(7n+7),.col-8 li:nth-child(8n+8)").addclass('nomargin'); $(".link a:last-child").addclass('lastlink'); $('.subnav a:last-child,.slider_tab a:last-child').addclass('last'); $("ul.oddsitem li").each(function(i){$(this).addclass('odds'+ i)}); $("ul.oddsitem li:odd").addclass('odd'); $('ul.menu li.hassub').hover(function(){ $('.navfullwrap').addclass('open'); },function(){ $('.navfullwrap').removeclass('open'); }); //客服 $(".kf span").hover(function () { $(this).find("div").show(); }, function () { $(this).find("div").hide(); }); $(".kf span div").hover(function () { $(this).show(); }, function () { $(this).hide(); }); $(".kf span:nth-child(5)").click(function () { $("html,body").animate({ "scrolltop": 0 }, 1000); }); //收起客服 var i = 0; $(".shou").click("fast", function () { i++; if (i % 2 == 0) { $(this).css({ "background": "url(/public/app/images/kefq.png) no-repeat center #fff" }); $(".kf").css({ "right": "30px" }); }else { $(this).css({ "background": "url(/public/app/images/kefq1.png) no-repeat center #fff" }); $(".kf").css({ "right": "-67px" }); } //展开客服 $(".zhan").click(function () { $(this).delay(10000).stop().fadeout(); $(".kf").css({ "right": "20px" }); $(".shou").css({ "right": "92px" }); }); }); //回到顶部 $(".up").click(function(){ $("html,body").animate({"scrolltop":0}, 1000); }); $('#opensearch').bind('click',function(){ $(this).toggleclass('open'); $('.search').toggleclass('open'); }); $(".about_link ul,ul.department_link").each(function(){ $(this).find("li").each(function(i){ $(this).addclass("item" + i); }); }); $('#dosearch').click(function(){ if ($("#kword").val() =="请输入关健词") { alert('请输入关健词') return false; } if ($("#kword").val() =="") { alert('请输入关健词') return false; } return true; }); $('.picslider').flexslider({ selector: ".pic > li", animation: "slide", controlnav: true, directionnav:false, multiplekeyboard:true, pauseonaction: false, animationloop: false, slideshow: true, slideshowspeed: 6000, easing:"swing" }); $(".tab-btn").each(function(){ $(this).find("a").each(function(i){ $(this).attr("id","widget" + i); }); }); $('.tab-btn a').click(function(){ $(this).addclass("active").siblings().removeclass("active"); $("."+$(this).attr("id")).show().siblings().hide(); }); sethover2(); }); function sethover2(){ var url2 = window.location.pathname; $("ul.cage-item li a").each(function(){ if ($(this).attr("href") == url2){ $(this).parent().addclass("current").siblings().find('a').removeclass("current"); }; }); }