(function ($) { $.fn.animatingNumber = function (options) { var settings = { element: this, startNum: options.from, endNum: options.to, duration: options.duration || 2000, callback: options.callback }; var timer = null; var methods = { start: function () { var _this = this; _this.animate(); }, stop: function () { if (timer) { clearTimeout(timer); timer = null; } }, animate: function () { var _this = this; var curNum = settings.startNum; var animateTime = 0; var range = settings.endNum - settings.startNum; var timerStep = Math.abs(Math.floor(settings.duration / range)); timerStep = timerStep > 20 ? timerStep : 20; var numStep = (range / settings.duration) * timerStep; _this.stop(); (function animate() { timer = setTimeout(function () { curNum = Math.ceil(curNum + numStep); if ((settings.endNum > settings.startNum && curNum >= settings.endNum) || (settings.endNum < settings.startNum && curNum <= settings.endNum)) { curNum = settings.endNum; } settings.element.text(curNum); animateTime++; if (typeof settings.callback == 'function') { settings.callback(curNum); } animate(); if (curNum >= settings.endNum) { _this.stop(); } }, timerStep); })(); } }; return this.each(function () { return methods.start(); }); }; })(jQuery); $(function () { $(window).scroll(function () { var scrTop = $(".he_content").offset().top; if (scrTop > 100) { $("body").addClass("anim2"); } else { $("body").removeClass("anim2"); } }); var href = window.location.href; var group = new RegExp("/group/"); var business = new RegExp("/business/"); var domain = new RegExp("/domain/"); var service = new RegExp("/service/"); var teamwork = new RegExp("/teamwork/"); var AboutUs = new RegExp("/AboutUs.aspx"); var honor = new RegExp("/honor.aspx"); var course = new RegExp("/course.aspx"); var party = new RegExp("/party.aspx"); var news = new RegExp("/news.aspx"); var industry = new RegExp("/industry.aspx"); var Inner = new RegExp("/Inner.aspx"); var seek = new RegExp("/seek.aspx"); var video = new RegExp("/video.aspx"); var activity = new RegExp("/activity.aspx"); var interview = new RegExp("/interview.aspx"); var develop = new RegExp("/develop.aspx"); var exploit = new RegExp("/exploit.aspx"); var manage = new RegExp("/manage.aspx"); var investment = new RegExp("/investment.aspx"); var study = new RegExp("/study.aspx"); var feedback = new RegExp("/feedback.aspx"); var cOn = 0; var pOn = 0; //栏目导航 if (group.test(href)) { cOn = 1; } else if(business.test(href)){ cOn = 2; }else if(domain.test(href)){ cOn = 3; }else if(service.test(href)){ cOn = 4; }else if(teamwork.test(href)){ cOn = 5; }else { cOn = 0; } //页面导航 if (cOn == 1) { if (AboutUs.test(href)) { pOn = 0; } else if (honor.test(href)) { pOn = 1; } if (course.test(href)) { pOn = 2; } if (party.test(href)) { pOn = 3; } if (news.test(href)||industry.test(href)||Inner.test(href)||seek.test(href)) { pOn = 4; } if (video.test(href) || activity.test(href) || interview.test(href)) { pOn = 5; } else { pOn = 7; } } if (cOn == 2) { if (develop.test(href)) { pOn = 1; } else if (exploit.test(href)) { pOn = 2; } if (manage.test(href)) { pOn = 5; } if (investment.test(href)) { pOn = 3; }if (study.test(href)) { pOn = 4; } } if(feedback.test(href)){ pOn = 1 } $(".he_liBlock").eq(cOn).addClass("cur"); $(".InnNav_a").eq(pOn).addClass("cur"); function currentPage(elem) { var url = window.location.href; var aryUrl = url.split("//"); var st_herf = aryUrl[1].indexOf("/"); //返回某个指定的字符串值在字符串中首次出现的位置 var relUrl = aryUrl[1].substring(st_herf); //stop省略,截取从start开始到结尾的所有字符 $("a",elem).each(function (i) { var link = $("a", elem).eq(i).attr('href'); var reg = new RegExp(link, "i"); if (reg.test(relUrl)) { $("a", elem).eq(i).addClass("cur").siblings().removeClass("cur"); //console.log(i); }; }); }; currentPage(".InnNav_ul"); }) //产业招商定位使用的 ;(function ($) { $.fn.setPlace = function (options) { var defau = { imgWidth: 1200, //上传图片的宽度 imgHeight: 911 //上传图片的高度 }; var self = $.extend(defau, options, {}); return this.each(function () { //data-site="100,100" left,top var that = $(this); var boxW = that.parent().width(); var site = new Array(); var plac = new Array(); var ir = self.imgHeight / self.imgWidth; //原图片的高宽比 var boxH = Math.round(boxW * ir); var boxL = 0, boxT = 0; site = that.attr("data-site"); plac = site.split(","); if (site == "" || site == undefined || site == null) { plac[0] = 0; plac[1] = 0; }; boxL = Math.round(plac[0]) + "px"; //位置left的值 boxT = Math.round(plac[1]) + "px"; //位置top的值 that.css({ left: boxL, top: boxT}); }) } })(jQuery); function webse() { var rat = 472 / 600, bxw = $(".dm-hy").width(); var boxH = Math.round(rat * bxw); $(".dm-infor").css({ height: boxH }); }; var module = { listAuto: function () { //产业-产业集聚 摆列方式 var maxRow = 5; var leg = $(".gather .grids").length; if (leg > maxRow) { var row = leg / 2; $(".gather .grids").css({ width: 100 / row + "%",'float':'left' }); } }, domain: function () { var lg = $("#dm-daib .swiper-slide").length; if (lg >= 3) { $("#dm-daib").removeClass("center"); var daib = new Swiper('#dm-daib', { loop: false, slidesPerView: 3, spaceBetween : 20, pagination: '.pagination', paginationClickable: true, }); }; var th = $("#fwal .swiper-slide").length; $("#fwal").addClass("center"); $('.fw-prev').hide(); $('.fw-next').hide(); if (th > 3) { $("#fwal").removeClass("center"); $('.fw-prev').show(); $('.fw-next').show(); var hezuo = new Swiper('#fwal', { loop: false, slidesPerView: 3, }); $('.fw-prev').click(function () { hezuo.slidePrev(); }); $('.fw-next').click(function () { hezuo.slideNext(); }); }; var ng = $("#xqhz .swiper-slide").length; $("#xqhz").addClass("center"); $('.xq-prev').hide(); $('.xq-next').hide(); if (ng > 3) { $("#xqhz").removeClass("center"); $('.xq-prev').show(); $('.xq-next').show(); var xqhz = new Swiper('#xqhz', { loop: false, slidesPerView: 3, }); $('.xq-prev').click(function () { xqhz.slidePrev(); }); $('.xq-next').click(function () { xqhz.slideNext(); }); } }, ToTop: function (ids) { var that = this; var ids = $(ids); var Doing = "
顶部
"; ids.append(Doing); var btn = $("#ToTop"); btn.hide(); $(window).scroll(function () { var t = $(document).scrollTop(); if (t > 300) { btn.fadeIn(); } else { btn.fadeOut(); } }); btn.bind('click', function () { $("html,body").animate({ scrollTop: 0 }, 'slow'); return false; }); } }; $(function () { webse(); $(window).on("resize", function () { webse(); }); module.listAuto(); module.ToTop("body"); // 图片懒加载 $(".lazy").imgLazing(); }); (function ($) { $.fn.imgLazing = function (options) { var setUp = $.extend({ url: 'data-src' }, options || {}); var chace = []; $(this).each(function () { var node = this.nodeName.toLowerCase(); // 对象中每个dom对象的节点类型 var _src = $(this).attr(setUp.url); //取出每个dom对象上设置的图片路径 var parentBox = $(setUp.parentBox); var boxH = Math.floor($(this).parent().width() * (3 / 4)); $(this).parent().css({ height: boxH, 'overflow': 'hidden' }); var data = { obj: $(this), url: _src, tag: node }; chace.push(data); }); var imgLoad = function () { $.each(chace, function (i, data) { var $obj = data.obj, $url = data.url, $tag = data.tag; if ($obj) { var winH = $(window).height(); var sTop = $(window).scrollTop(); var oTop = $obj.offset().top; var post = oTop - (sTop + winH); if (post < 0) { if ($url) { if ($tag === "img") { $obj.attr("src", $url); $obj.parent().removeAttr("style"); $obj.removeAttr(setUp.url) } else { return false; } } data.url = null; } } }) } imgLoad(); $(window).on("scroll", function () { imgLoad() }); } })(jQuery); // 模块 var modulePage = {} //在首页中使用的 modulePage.HomePage = function () { var winW = $(window).width(), winH = $(window).height(); //产业跨界 var wpw = $(".ind3_content .ind3_ul").width(); var ind3_li_boxW = $(".ind3_ul .ind3_li").width(); var ind3_li_boxH = ind3_li_boxW; if (winW < 1020) { $(".ind3_content").css({ height: Math.round(winW * (579 / 1919)) + 120 }); $(".ind3_ul .ind3_li .ta").css({width: ind3_li_boxW, height: ind3_li_boxH }); }; };