$(function () { //banner轮播图 var swiper = undefined; if($(document).width() > 1024) { swiper = new swiper(".myswiper", { spacebetween: 30, effect: "fade", // speed: 1000, fadeeffect: { crossfade: true, }, loop: true, // 循环模式选项 // autoplay: { // delay: 3000, // stoponlastslide: false, // disableoninteraction: false, // }, on: { init: function () { swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function () { swiperanimate(this); //每个slide切换结束时也运行当前slide动画 if (this.realindex != 0) { $('.banner_img').eq(this.realindex + 1).find('img').css({ "transform": "scale(1.2)", "transition": "all 5s" }) $('.banner_img').eq(this.realindex + 1).siblings().find('img').css({ "transform": "scale(1)" }) } else { $('.banner_img img').css({ "transform": "scale(1)", "transition": "all 0s" }) } //this.slides.eq(this.activeindex).find('.ani').removeclass('ani'); 动画只展现一次,去除ani类名 }, }, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, pagination: { el: ".swiper-pagination", type: 'progressbar',//进度条样式 }, }); } else { swiper = new swiper(".myswiper", { direction: 'horizontal', observer: true, observeparents: true, autoplay: { delay: 2000, stoponlastslide: false, disableoninteraction: true, }, // spacebetween: 30, // effect: "fade", // speed: 1000, // fadeeffect: { // crossfade: true, // }, loop: true, // 循环模式选项 // autoplay: { // delay: 3000, // stoponlastslide: false, // disableoninteraction: false, // }, on: { init: function () { swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function () { swiperanimate(this); //每个slide切换结束时也运行当前slide动画 if (this.realindex != 0) { $('.banner .swiper_img img').css({ "transform": "scale(1.2)", "transition": "all 5s" }) } else { $('.banner .swiper_img img').css({ "transform": "scale(1)", "transition": "all 0s" }) } //this.slides.eq(this.activeindex).find('.ani').removeclass('ani'); 动画只展现一次,去除ani类名 }, }, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, pagination: { el: ".swiper-pagination", type: 'progressbar',//进度条样式 }, }); } if($(document).width()<1004){ swiper.removeslide(0); } //news轮播图 var news_swiper = undefined; news_swiper = new swiper(".newsswiper", { spacebetween: 0, // loop: true, // 循环模式选项 // autoplay: { // delay: 8000, // stoponlastslide: false, // disableoninteraction: false, // }, on: { init: function () { swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function () { swiperanimate(this); //每个slide切换结束时也运行当前slide动画 //this.slides.eq(this.activeindex).find('.ani').removeclass('ani'); 动画只展现一次,去除ani类名 } }, }); //手风琴 $(".sfq>div").hover(function () { let $this = $(this); $this.addclass('active'); $this.siblings().removeclass('active'); $this.stop().animate({ "width": "50%" }, 800, "easeinoutsine").siblings().stop().animate({ "width": "25%" }, 800, "easeinoutsine") $this.find(".sfq_defalt>span:eq(0)").css({ "transform": "translatey(-2rem)", "opacity": "0" }) $this.siblings().find(".sfq_defalt>span:eq(0)").css({ "transform": "translatey(0rem)", "opacity": "1" }) $this.find(".sfq_defalt>span:eq(1)").css({ "transform": "translatey(1rem)", "opacity": "0" }) $this.siblings().find(".sfq_defalt>span:eq(1)").css({ "transform": "translatey(0rem)", "opacity": "1" }) $this.find(".sfq_defalt>span:eq(2)").css({ "transform": "translatey(1rem)", "opacity": "0" }) $this.siblings().find(".sfq_defalt>span:eq(2)").css({ "transform": "translatey(0rem)", "opacity": "1" }) $this.find(".sfq_defalt>span:eq(3)").css({ "opacity": "0" }) $this.siblings().find(".sfq_defalt>span:eq(3)").css({ "opacity": "0.2" }) $this.find(".sfq_active>li").delay(1000).css({ "opacity": "1", // "transition": "all 2s" }) $this.siblings().find(".sfq_active>li").delay(1000).css({ "opacity": "0", // "transition": "all 1s" }) $this.find(".sfq_active>li:eq(1)").delay(1000).css({ "opacity": "1", "width": "3rem", // "transition": "all 1s" }) $this.siblings().find(".sfq_active>li:eq(1)").css({ "opacity": "0", "width": "1rem", // "transition": "all 1s" }) }) // $(".sfq>div").hover(function () { // $(this).stop().animate({ // "width": "50%" // }, 800, "easeinoutsine").siblings().stop().animate({ // "width": "25%" // }, 800, "easeinoutsine") // $(this).find(".sfq_defalt>span:eq(0)").css({ // "transform": "translatey(-2rem)", // "opacity": "0" // }) // $(this).siblings().find(".sfq_defalt>span:eq(0)").css({ // "transform": "translatey(0rem)", // "opacity": "1" // }) // $(this).find(".sfq_defalt>span:eq(1)").css({ // "transform": "translatey(1rem)", // "opacity": "0" // }) // $(this).siblings().find(".sfq_defalt>span:eq(1)").css({ // "transform": "translatey(0rem)", // "opacity": "1" // }) // $(this).find(".sfq_defalt>span:eq(2)").css({ // "transform": "translatey(1rem)", // "opacity": "0" // }) // $(this).siblings().find(".sfq_defalt>span:eq(2)").css({ // "transform": "translatey(0rem)", // "opacity": "1" // }) // $(this).find(".sfq_defalt>span:eq(3)").css({ // "opacity": "0" // }) // $(this).siblings().find(".sfq_defalt>span:eq(3)").css({ // "opacity": "0.2" // }) // $(this).find(".sfq_active>li").delay(1000).css({ // "opacity": "1", // // "transition": "all 2s" // }) // $(this).siblings().find(".sfq_active>li").delay(1000).css({ // "opacity": "0", // // "transition": "all 1s" // }) // $(this).find(".sfq_active>li:eq(1)").delay(1000).css({ // "opacity": "1", // "width": "3rem", // // "transition": "all 1s" // }) // $(this).siblings().find(".sfq_active>li:eq(1)").css({ // "opacity": "0", // "width": "1rem", // // "transition": "all 1s" // }) // // $(this).children().eq(0).css({ // // "transform": "scale(1.1)" // // }) // // $(this).siblings().children().eq(0).css({ // // "transform": "scale(1)" // // }) // }) //应用案例 var swiper1 = new swiper(".swiper1", { loop: true, grabcursor: true, navigation: { nextel: ".next1", prevel: ".prev1", }, lazy: { loadprevnext: true, }, on: { init: function () { swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function () { swiperanimate(this); //每个slide切换结束时也运行当前slide动画 // console.log(this.activeindex); }, } }); // var currentpage = $('.case .left .page span').eq(0); // var totalpage = $('.case .left .page span').eq(1); // totalpage.text('0' + ($('.case .swiper-wrapper').children().length)) // var cswiper = undefined; // cswiper = new swiper(".case_swiper", { // speed: 1000, // slidesperview: 1, // loop: true, // 循环模式选项 // // autoplay: { // // delay: 5000, // // stoponlastslide: false, // // disableoninteraction: false, // // }, // navigation: { // nextel: ".next", // prevel: ".prev", // }, // on: { // slidechange: function (e) { // // console.log(this.realindex); // currentpage.text('0' + (this.realindex + 1)) // $('.case .arrow_right li').css({ // "animation": "", // "opacity": "0" // }) // $('.case .arrow_left li').css({ // "animation": "", // "opacity": "0" // }) // } // }, // }); // $('.case .next').on('click', function () { // $('.case .arrow_left li').css({ // "animation": "rightarrow 0.7s linear", // "opacity": "1" // }) // }) // $('.case .next').hover( // function () { // $('.case .arrow_left li').css({ // "opacity": "1", // "animation": "rightarrow 2s linear infinite", // }) // }, // function () { // $('.case .arrow_left li').css({ // "opacity": "0", // "animation": "" // }) // } // ) // $('.case .prev').on('click', function () { // $('.case .arrow_right li').css({ // "animation": "leftarrow 0.7s linear", // "opacity": "1" // }) // }) // $('.case .prev').hover( // function () { // $('.case .arrow_right li').css({ // "opacity": "1", // "animation": "leftarrow 2s linear infinite", // }) // }, // function () { // $('.case .arrow_right li').css({ // "opacity": "0", // "animation": "" // }) // } // ) // var currentpage = $('.case .left .page span').eq(0); // var totalpage = $('.case .left .page span').eq(1); // totalpage.text('0' + ($('.case .swiper-wrapper').children().length)) // var cswiper = undefined; // cswiper = new swiper(".case_swiper", { // speed: 1000, // slidesperview: 1, // loop: true, // 循环模式选项 // // autoplay: { // // delay: 5000, // // stoponlastslide: false, // // disableoninteraction: false, // // }, // navigation: { // nextel: ".swiper-button-next", // prevel: ".swiper-button-prev", // }, // on: { // slidechangetransitionend: function (e) { // // console.log(this.realindex); // currentpage.text('0' + (this.realindex + 1)) // $('.case .arrow_right li').css({ // "animation": "", // "opacity": "0" // }) // $('.case .arrow_left li').css({ // "animation": "", // "opacity": "0" // }) // } // }, // }); // $('.caseswiper .next').on('click', function () { // $('.case .arrow_left li').css({ // "animation": "rightarrow 0.7s linear", // "opacity": "1" // }) // }) // $('.caseswiper .next').hover( // function () { // $('.case .arrow_left li').css({ // "opacity": "1", // "animation": "rightarrow 2s linear infinite", // }) // }, // function () { // $('.case .arrow_left li').css({ // "opacity": "0", // "animation": "" // }) // } // ) // $('.caseswiper .prev').on('click', function () { // $('.case .arrow_right li').css({ // "animation": "leftarrow 0.7s linear", // "opacity": "1" // }) // }) // $('.caseswiper .prev').hover( // function () { // $('.case .arrow_right li').css({ // "opacity": "1", // "animation": "leftarrow 2s linear infinite", // }) // }, // function () { // $('.case .arrow_right li').css({ // "opacity": "0", // "animation": "" // }) // } // ) //数字++ $(window).on('scroll', function () { var otop = $('.hill').offset().top, oheight = $('.hill').innerheight(), screenscroll = $(window).scrolltop(), screenheight = $(window).height(); if (($('.timer').text() == "") && (screenscroll < otop + oheight / 3 * 2) && (screenscroll + screenheight > otop + oheight / 3)) { $('.timer').each(count); } }) $(window).on('scroll', function() { var otop = $('.img-top').offset().top, screenscroll = $(window).scrolltop(); if((otop - screenscroll) < 700){ $('.banner').hide(); // $('.m-banner').hide(); }else{ // if($(window).width() < 1004){ // // $('.m-banner').show(); // }else{ // $('.banner').show(); // } $('.banner').show(); } }) var top = undefined; $('.video-box .play').click(function(){ $('.popups').fadein(300); top = $(window).scrolltop(); $('body').css("top", -top + "px"); $('body').addclass('fixed'); }) $('.popups .close').click(function(){ $('.popups').fadeout(300); $('body').removeclass('fixed'); $('body').removeattr("style"); $(window).scrolltop(top); document.getelementbyid("videoshow").pause(); $("div.videobtn").stop(false, true).fadein({ duration: 380, easing: "easeinquart" }); }); })