var bannerswiper = new swiper('.banner .swiper-container', { autoplay: { delay: 5000, disableoninteraction: false, }, speed: 500, spacebetween: 0, effect: 'fade', loop: true,//必须 pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextel: '.swiper-button-next1', prevel: '.swiper-button-prev1', }, }); //新闻滚动// $(".fc_list li:first").addclass("casehover"); $(".fc_box .fc_nr").eq(0).show(); $(".fc_list li").hover(function () { $(this).addclass("casehover").siblings().removeclass("casehover"); $(".fc_box .fc_nr").hide().eq($(this).index()).show(); }, function () { }); $(".news_list li:first").addclass("casehover"); $(".news_box .news_nr").eq(0).show(); $(".news_list li").hover(function () { $(this).addclass("casehover").siblings().removeclass("casehover"); $(".news_box .news_nr").hide().eq($(this).index()).show(); }, function () { }); jquery(".pro_center").slide({ titcell: ".pro_l li", maincell: ".pro_box2", effect: 'leftloop' }); jquery(".product").slide({ titcell: ".pro_list li", maincell: ".pro_box", effect: 'leftloop' }); jquery(".case_box").slide({ maincell: ".bd ul", effect: "leftloop", autoplay: true, vis: 3, scroll: 1, delaytime: 500, prevcell: ".next", nextcell: ".prev" }); jquery(".ys_box").slide({ maincell: ".bd ul", effect: "leftloop", autoplay: true, vis: 1, scroll: 1, delaytime: 500, prevcell: ".next", nextcell: ".prev" }); var caseswiper = new swiper(".case_box .myswiper", { slidesperview: 3, spacebetween: 40, slidespergroup: 1, loop: true, loopfillgroupwithblank: true, autoplay: { delay: 3500, disableoninteraction: false, }, }); jquery(".fc_list").slide({}); $('.ab_list li').mouseenter(function () { $(this).addclass('on').siblings('li').removeclass('on') }) $('.pro_list li').mouseenter(function () { $(this).addclass('on').siblings('li').removeclass('on') }) $('.fc_box li').mouseenter(function () { $(this).addclass('on').siblings('li').removeclass('on') }) $('.news_nr li').mouseenter(function () { $(this).addclass('on').siblings('li').removeclass('on') }) $(window).scroll(function () { var wtop = $(window).scrolltop(); var wh = $(window).height(); $('.sjctop').each(function () { var divtop = $(this).offset().top - (wh / 2); var divtopw = (divtop - wtop) / 10 + 20; $(this).css("transform", "translate(0px," + divtopw + "px)"); }); $('.sjcright').each(function () { var divtop = $(this).offset().top - (wh / 2); var divtopw = (divtop - wtop) / 10 + 30; $(this).css("transform", "translate(" + -divtopw + "px,0px)"); }); $('.sjcleft').each(function () { var divtop = $(this).offset().top - (wh / 2); var divtopw = (divtop - wtop) / 10 + 30; $(this).css("transform", "translate(" + divtopw + "px,0px)"); }); $('.sjcbottom').each(function () { var divtop = $(this).offset().top - (wh / 2); var divtopw = (divtop - wtop) / 10 - 20; $(this).css("transform", "translate(0px," + -divtopw + "px)"); }); $('.bottomwow').each(function () { var litop = $(this).offset().top - wh / 3 * 2; var sstop = litop - wtop; if (litop >= wtop) { $(this).css({ 'transform': "translate(" + -(sstop) / 5 + "px,0px)", 'opacity': 1 - sstop / 600 }); } else { $(this).css({ 'transform': "translate(0,0", 'opacity': "1" }); } }); $('.rightwow').each(function () { var litop = $(this).offset().top - wh / 3 * 2; var sstop = litop - wtop; if (litop >= wtop) { $(this).css({ 'transform': "translate(" + (sstop) / 5 + "px,0px)", 'opacity': 1 - sstop / 600 }); } else { $(this).css({ 'transform': "translate(0,0", 'opacity': "1" }); } }); $('.leftwow').each(function () { var litop = $(this).offset().top - wh / 3 * 2; var sstop = litop - wtop; if (litop >= wtop) { $(this).css({ 'transform': "translate(" + -(sstop) / 5 + "px,0px)", 'opacity': 1 - sstop / 600 }); } else { $(this).css({ 'transform': "translate(0,0", 'opacity': "1" }); } }); $('.bottomwow').each(function () { var litop = $(this).offset().top - wh / 3 * 2; var sstop = litop - wtop; if (litop >= wtop) { $(this).css({ 'transform': "translate(0px," + (sstop) / 5 + "px)", 'opacity': 1 - sstop / 600 }); } else { $(this).css({ 'transform': "translate(0,0", 'opacity': "1" }); } }); }); var lock = true; $(window).scroll(function () { var windowtop = $(window).scrolltop(); var numrowtop = $('.fw_box').offset().top - 800; if (windowtop >= numrowtop && lock) { $('.scrollnum').countto({ lastsymbol: "", //显示在最后的字符 from: 0, // 开始时的数字 speed: 3000, // 总时间 refreshinterval: 100, // 刷新一次的时间 beforesize: 0, //小数点前最小显示位数,不足的话用0代替 decimals: 0, // 小数点后的位数,小数做四舍五入 }) lock = false; } }) var onav = $('#loutinav');//导航壳 var anav = onav.find('li');//导航 var adiv = $('#main .louceng');//楼层 var otop = $('#gotop'); //回到顶部 $(window).scroll(function () { var winh = $(window).height();//可视窗口高度 var itop = $(window).scrolltop();//鼠标滚动的距离 if (itop >= $('#header').height()) { onav.fadeout(); otop.fadeout(); //鼠标滑动式改变 adiv.each(function () { if (winh + itop - $(this).offset().top > winh / 2) { anav.removeclass('active'); anav.eq($(this).index()).addclass('active'); } }) } else { onav.fadeout(); otop.fadeout(); } }) //点击top回到顶部 otop.click(function () { $('body,html').animate({ "scrolltop": 0 }, 500) }) //点击回到当前楼层 anav.click(function () { var t = adiv.eq($(this).index()).offset().top; $('body,html').animate({ "scrolltop": t }, 500); $(this).addclass('active').siblings().removeclass('active'); }); var xroll = function (el, fn) { xroll.prototype.init(el, fn) }; xroll.prototype = { init: function (_el, fn) { _el.attr("data-state", false); this.start(_el, fn); $(window).on("scroll", function () { xroll.prototype.start(_el, fn) }) }, start: function (_el, fn) { var _this = this; $(_el).each(function () { var _self = $(this); var xrolltop = $(window).scrolltop(); var iswindowheiget = $(window).height(); if (_self.data().state) { return }; if (xrolltop + iswindowheiget > $(this).offset().top) { fn(_self); settimeout(function () { _self.attr("data-state", true); _self.data().state = true }) } }) } }; xroll($('.blur-image'), function(e) { $(e).addclass('clear-image') });