/*! * jquery.mousedelay.js v1.2 * http://www.planeart.cn/?p=1073 * copyright 2011, tangbin * dual licensed under the mit or gpl version 2 licenses. */ (function ($, plugin) { var data = {}, id = 1, etid = plugin + 'etid'; // 延时构造器 $.fn[plugin] = function (speed, group) { id ++; group = group || this.data(etid) || id; speed = speed || 100; // 缓存分组名称到元素 if (group === id) this.data(etid, group); // 暂存官方的hover方法 this._hover = this.hover; // 伪装一个hover函数,并截获两个回调函数交给真正的hover函数处理 this.hover = function (over, out) { over = over || $.noop; out = out || $.noop; this._hover(function (event) { var elem = this; cleartimeout(data[group]); data[group] = settimeout(function () { over.call(elem, event); }, speed); }, function (event) { var elem = this; cleartimeout(data[group]); data[group] = settimeout(function () { out.call(elem, event); }, speed); }); return this; }; return this; }; // 冻结选定元素的延时器 $.fn[plugin + 'pause'] = function () { cleartimeout(this.data(etid)); return this; }; // 静态方法 $[plugin] = { // 获取一个唯一分组名称 get: function () { return id ++; }, // 冻结指定分组的延时器 pause: function (group) { cleartimeout(data[group]); } }; })(jquery, 'mousedelay'); //选中 $("#m"+m).addclass("aon"); //整站无图处理 jquery.each(jquery("img"), function (i, n) { jquery(n).on('error',function () { n.src = nopicpath; }); n.src = n.src; }); //打开语言切换 $(".language dt").click(function(e) { if($(this).hasclass("on")){ $(this).removeclass("on"); }else{ $(this).addclass("on"); } $(".language dd").stop(true, true).slidetoggle(); $(document).on("click", function() { $(".language dd").stop(true, true).slideup(); $(".language dt").removeclass("on"); }); e.stoppropagation(); }); $(".language dd").on("click", function(e) { e.stoppropagation(); }); //导航下拉 $(".top-menu li").hover(function(e) { $(this).siblings().removeclass("aon"); $(this).addclass("aon"); },function(){ $(this).removeclass("aon"); $("#m"+m).addclass("aon"); }); $(".top-menu li").each(function() { var num=$(this).find("dl").find("dd").length if(num>=1){ $(this).addclass("has-dl"); $(this).mousedelay(false).hover(function(e) { $(this).find("dl").slidedown('fast'); },function(){ $(this).find("dl").slideup('fast'); }); } }); //图册 $('.top-image .slider-big').slick({ arrows: false, fade: true, asnavfor: '.top-image .slider-small' }); $('.top-image .slider-small').slick({ slidestoshow: 3, asnavfor: '.top-image .slider-big', vertical: true, focusonselect: true }); window.onload=function(){ imageh() } $(window).resize(function(e) { imageh() }); function imageh(){ var smallh=$('.top-image .slider-small').outerheight() $('.top-image .slider-big').height(smallh); } //人员招聘 $(".list-job .list").each(function() { $(this).find(".type").click(function(){ if($(this).attr("id")=="on"){ $(this).attr("id"," "); $(this).next(".con").slideup('fast'); }else{ $(this).attr("id","on"); $(this).next(".con").slidedown('fast'); $(this).parent(".list").siblings().find(".con").slideup('fast'); $(this).parent(".list").siblings().find(".type").attr("id"," "); } }); }); $(".list-job .list").eq(0).find(".type").click(); //打开移动端导航 $(".open-menu").click(function(e) { if($(this).hasclass("open-menu-on")){ $(this).removeclass("open-menu-on") }else{ $(this).addclass("open-menu-on") } $(".top-menu").slidetoggle(); }); $(".nav-menu header").click(function(e) { if($(this).hasclass("on")){ $(this).removeclass("on") }else{ $(this).addclass("on") } $(".nav-menu ul").slidetoggle(); }); //home $('.home-banner .slider').slick({ autoplay: true, autoplayspeed: 4000, arrows: false, dots: true }); $('.home-notice .slider').slick({ autoplay: true, autoplayspeed: 3000, vertical: true, slidestoshow: 3 }); //links $('.home-links .slider').slick({ slidestoshow: 5, slidestoscroll: 1, autoplay: true, autoplayspeed: 3000, responsive: [ { breakpoint: 1024, settings: {slidestoshow: 4,slidestoscroll: 4} }, { breakpoint: 700, settings: {slidestoshow: 3,slidestoscroll: 3} }, { breakpoint: 480, settings: {slidestoshow: 2,slidestoscroll: 2} } ] }); //news $(".home-news .tab dd").click(function(e) { var e=$(this).index()+1 var html=$("#copy-"+e).html() $(this).addclass("on"); $(this).siblings().removeclass("on"); $(".home-news .tab-info").remove(); $(".home-news .tab").after("
"+html+"
"); tabslider() }); $(".home-news .tab dd").eq(0).click(); function tabslider(){ $('.home-news .tab-info .slider').slick({ autoplay: true, autoplayspeed: 3000, arrows: false, dots: true, fade: true }); } //service palthfrom $(".home-platform .slider").slick({ slidestoshow: 3, slidestoscroll: 3, arrows: false, infinite: false, dots: true, responsive: [ { breakpoint: 1024, settings: {slidestoshow: 4,slidestoscroll: 4} }, { breakpoint: 768, settings: {slidestoshow: 3,slidestoscroll: 3} }, { breakpoint: 600, settings: {slidestoshow: 2,slidestoscroll: 2} } ] }); $(".home-service .slider").slick({ slidestoshow: 3, responsive: [ { breakpoint: 768, settings: {slidestoshow: 2} }, { breakpoint: 480, settings: {slidestoshow: 1} } ] });