锘?/ 鍥剧墖鎳掑姞杞 (function ($) { $.fn.imgLoad = function (options) { var setUp = $.extend({ url: 'data-src', bgImg: false }, options || {}); var chace = []; $(this).each(function () { var node = this.nodeName.toLowerCase(); var _src = $(this).attr(setUp.url); var data = { obj: $(this), url: _src, tag: node }; chace.push(data) }); var imgLoader = 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") { if (setUp.bgImg) { $obj.parent().css({ "background": "#FFF url(" + $url + ") no-repeat center" }) } else { $obj.attr("src", $url); }; } else { return false } }; data.url = null } } }) }; imgLoader(); $(window).on("scroll", function () { imgLoader() }) } })(jQuery); // 婊氬姩鍏冪礌娣诲姞鍔ㄧ敾 (function ($) { $.fn.elScroll = function (options) { var defaults = { anima: "data-anim", delay: 'data-delay', site: 0.9 }; var setting = $.extend(defaults, options, {}); var arry = []; $(this).each(function () { var that = $(this), clas = that.attr(setting.anima), dely = that.attr(setting.delay); var child = that.children(); child.wrapAll("
"); var aniBox = that.find(".ani-box"); var site = setting.site; var data = { obj: that, aBox: aniBox, site: site }; aniBox.addClass(clas).css({ 'transition-delay': +dely + "s", '-webkit-transition-delay': +dely + "s", '-moz-transition-delay': +dely + "s" }); arry.push(data); }); function scrolAnimade() { $.each(arry, function (i, data) { var obj = data.obj, site = data.site, aniBox = data.aBox; if (obj) { var winH = $(window).height(), sTop = $(document).scrollTop(), grow = winH * site, eTop = obj.offset().top, post = sTop + grow; if (eTop < post) { obj.addClass("show"); }; }; }); }; scrolAnimade(); $(window).on('scroll', function () { scrolAnimade() }); } })(jQuery); // 鍏冪礌婊氬姩鐩戝惉 娣诲姞鍔ㄧ敾 (function ($) { $.fn.elRoll = function (options) { var param = $.extend({ anima: "ani-anima", site: 0.9 }, options, {}); var arry = []; $(this).each(function () { var that = $(this); var site = param.site; var ani = that.attr(param.anima); var data = { obj: that, anima: ani, site: site }; arry.push(data); }); function runAnima() { $.each(arry, function (i, data) { var obj = data.obj, site = data.site, anima = data.anima; if (obj) { var winH = $(window).height(), sTop = $(document).scrollTop(), grow = winH * site, eTop = obj.offset().top, post = sTop + grow; if (eTop < post) { obj.addClass(anima); }; }; }); }; runAnima(); $(window).on('scroll', function () { runAnima() }); } })(window.jQuery); // 妯″潡鍖栨柟娉 var method = { home: function () { // 棣栭〉 var wind = $(window).width(); var sivble = 4; if (wind >= 980) { sivble = 4; } else if (wind <= 980 && wind >= 750) { sivble = 2; } else { sivble = 1; } // 涓氬姟 var busineSwiper = new Swiper('#busine-swiper', { slidesPerView: sivble, slidesPerGroup: 1, autoplay: 3500, speed: 1000, loop:true, paginationClickable: true, autoplayDisableOnInteraction: false, spaceBetween: 15 }); $(".busine .btn-prev").on("click", function () { busineSwiper.slidePrev(); }); $(".busine .btn-next").on("click", function () { busineSwiper.slideNext(); }); $(".level.busine").on("mouseenter", function () { busineSwiper.stopAutoplay(); }) $(".level.busine").on("mouseleave", function () { busineSwiper.startAutoplay(); }) // 棣栭〉鍥涗釜閾炬帴 $(".linkbar li").css({ width: 25 + "%" }); $(".linkbar li").hover(function () { $(".linkbar li").css({ width: 23 + "%" }); $(this).css({ width: 31 + "%" }); }, function () { $(".linkbar li").css({ width: 25 + "%" }) }) }, about: function () { // 鍏充簬鎴戜滑 // 浼佷笟鎰挎櫙 $(".vision-list .grid-item").each(function (n) { var number = n + 1; $(".vision-list .grid-item").eq(n).addClass("grid" + number); }); // 鍙戝睍鍘嗙▼ $(".history li").each(function () { $(".history li:even").addClass("even"); $(".history li:odd").addClass("odd"); }) }, businessPage: function () { // 涓氬姟棰嗗煙 var leng = $("#item-swiper .swiper-slide").length; var visble = 3; function websize() { var winWidth = $(window).width(); if (winWidth >= 768 && winWidth <= 980) { visble = 2 } else if (winWidth <= 760) { visble = 1 } else { visble = 3 } var itemSwiper = new Swiper('#item-swiper', { speed: 650, autoplay: 5000, slidesPerView: visble,//'auto' spaceBetween: 25, }); if (leng <= visble) { $(".item-list .btn").hide(); } else { $(".item-list .btn").show(); } $(".item-list .btn-prev").click(function () { itemSwiper.slidePrev(); }) $(".item-list .btn-next").click(function () { itemSwiper.slideNext(); }) }; websize(); $(window).resize(function () { setTimeout(function () { websize(); }, 100) }) }, cultureRun: function () { // 浼佷笟鏂囧寲 // 鍥剧墖鏌ョ湅鍣 if ($('.pic-galpop').length >= 1) { $('.pic-galpop').galpop(); } } }; // 杩愯鏂规硶 $(function () { // 棣栭〉banner var bannerSwiper = new Swiper('#banner-slide', { speed: 500, autoplay: 4400, autoplayDisableOnInteraction: false, effect: 'fade', pagination: '.swiper-pagination', paginationClickable: true, onSlideChangeStart: function (swiper) { nextSlide = swiper.slides.eq(swiper.activeIndex); nextSlide.addClass("cearBig"); }, onSlideChangeEnd: function (swiper) { prevSlide = swiper.slides[swiper.previousIndex]; prevSlide.className = "swiper-slide"; }, }); // 棣栭〉 method.home(); // 鍏充簬鎴戜滑 method.about(); // 涓氬姟棰嗗煙 method.businessPage(); // 浼佷笟鏂囧寲 method.cultureRun(); // 鍥剧墖鎳掑姞杞 $(".lazy").imgLoad(); // 鍏冪礌婊氬姩鐩戝惉 娣诲姞鍔ㄧ敾 $(".anime").elRoll(); // 鍏冪礌婊氬姩鐩戝惉娣诲姞鍔ㄧ敾 $(".animlayer").elScroll(); // 鐏鎻掍欢 $('.pic-galpop').galpop(); $(".job-desc .desc-word").mCustomScrollbar(); })