jquery(document).ready(function() { // jquery("img").lazyload({ // effect : "fadein" // }); new wow().init(); // header $(window).scroll(function() { if ($(window).scrolltop() > 0) { $(".header").addclass("header-small"); } else { $(".header").removeclass("header-small"); } }); if ($(window).scrolltop() > 0) { $(".header").addclass("header-small"); } else { $(".header").removeclass("header-small"); } $('.head-nav li').hover(function(){ $(this).find('.nav-main').addclass("show").stop(true,true); },function(){ $(this).find('.nav-main').removeclass("show").stop(true,true); }); // $(window).scroll(function() { // if ($(this).scrolltop() >= 900) { // // console.log(11); // $(".fix-right").fadein(500); // } else { // $(".fix-right").hide(); // } // }); $(".fhtop").click(function() { return $("body,html").animate({ scrolltop: 0 }, 500), !1 }); $(".pro .bot .mn .title").click(function() { $(this).find(".jt").toggleclass("on"); $(this).parent().find(".sum").stop().slidetoggle(); }); $(".news-list .tjpage .top").click(function() { $(this).toggleclass("on"); $(this).parent().find(".bot").stop().slidetoggle(); }); $('.head-menu').click(function(){ $(this).toggleclass('head-menu-close'); $('.header').toggleclass('head-open'); }); $('.mhead-main .phead-nav .item-links').click(function(){ $(this).siblings('.subnav-box').stop().slidetoggle("slow"); $(this).find('.jt').toggleclass("jt-rotate"); }); var swiperban = new swiper('.index-banner .swiper-container', { slidesperview :1, spacebetween: 0, speed:800, autoplay: { delay:9000, disableoninteraction: false, }, effect:'fade', fadeeffect: { crossfade: true, }, simulatetouch : false, on: { init: function(){ swiperanimatecache(this); swiperanimate(this); }, slidechangetransitionend: function(){ swiperanimate(this); }, slidechangetransitionstart: function(){ $('.index-bannerpage li.on').removeclass('on'); $('.index-bannerpage li').eq(swiperban.activeindex).addclass('on'); }, }, }); $('.index-bannerpage li').hover(function(){ var _ = $(this); _.addclass('on').siblings().removeclass('on'); swiperban.slideto(_.index()); return false; }); var swiperincore = new swiper('.swipercore', { watchslidesprogress: true, slidesperview: 'auto', // simulatetouch : false, centeredslides: true, loop: true, loopedslides: 5, navigation: { nextel: '.corepic .next', prevel: '.corepic .prev', }, on: { init: function(){ swiperanimatecache(this); swiperanimate(this); }, slidechangetransitionend: function(){ swiperanimate(this); }, progress: function(progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideprogress = this.slides[i].progress; modify = 1; if (math.abs(slideprogress) > 1) { modify = (math.abs(slideprogress) - 1) * 0.1 + 1; } translate = slideprogress * modify * 214 + 'px'; scale = 1 - math.abs(slideprogress) / 11; zindex = 999 - math.abs(math.round(10 * slideprogress)); slide.transform('translatex(' + translate + ') scale(' + scale + ')'); slide.css('zindex', zindex); slide.css('opacity', 1); if (math.abs(slideprogress) > 3) { slide.css('opacity', 0); } } }, settransition: function(transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } }, }, }); var swiperprole = new swiper('.index-pro .swiper-container.le', { slidesperview :1, spacebetween: 0, speed:800, // autoplay: { // delay:9000, // disableoninteraction: false, // }, effect:'fade', fadeeffect: { crossfade: true, }, simulatetouch : false, on: { init: function(){ swiperanimatecache(this); swiperanimate(this); }, slidechangetransitionend: function(){ swiperanimate(this); }, slidechangetransitionstart: function(){ $('.index-pro-page li.on').removeclass('on'); $('.index-pro-page li').eq(swiperprole.activeindex).addclass('on'); }, }, }); var swiperprori = new swiper('.index-pro .ri .swiper-container', { watchslidesprogress: true, slidesperview: 'auto', simulatetouch : false, centeredslides: true, loop: true, loopedslides: 5, on: { init: function(){ swiperanimatecache(this); swiperanimate(this); }, slidechangetransitionend: function(){ swiperanimate(this); }, slidechangetransitionstart: function(){ $('.index-pro-page li.on').removeclass('on'); $('.index-pro-page li').eq(swiperprole.realindex).addclass('on'); }, /*progress: function(progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideprogress = this.slides[i].progress; modify = 1; if (math.abs(slideprogress) > 1) { modify = (math.abs(slideprogress) - 1) * 0.026 + 1; } translate = slideprogress * modify * -761 + 'px'; scale = 1 - math.abs(slideprogress) / 4; zindex = 999 - math.abs(math.round(10 * slideprogress)); slide.transform('translatex(' + translate + ') scale(' + scale + ')'); slide.css('zindex', zindex); slide.css('opacity', 1); if (math.abs(slideprogress) > 2) { slide.css('opacity', 0); } } },*/ progress: function(progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideprogress = this.slides[i].progress; modify = 1; if (math.abs(slideprogress) > 1) { modify = (math.abs(slideprogress) - 1) * 0.3 + 1; } translate = slideprogress * modify * 569 + 'px'; scale = 1 - math.abs(slideprogress) / 5; zindex = 999 - math.abs(math.round(10 * slideprogress)); slide.transform('translatex(' + translate + ') scale(' + scale + ')'); slide.css('zindex', zindex); slide.css('opacity', 1); if (math.abs(slideprogress) > 3) { slide.css('opacity', 0); } } }, settransition: function(transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } }, }); $('.index-pro-page li').hover(function(){ var _ = $(this); _.addclass('on').siblings().removeclass('on'); swiperprole.slideto(_.index()); swiperprori.slidetoloop(_.index()); return false; }); });