var ctn6 = new swiper(".ctn6 .myswiper", { centeredslides: true, centeredslidesbounds: true, autoplay: { delay: 1500,//1秒切换一次 }, initialslide: 2, navigation: { nextel: ".ctn6 .swiper-button-next", prevel: ".ctn6 .swiper-button-prev", }, scrollbar: { el: ".ctn6 .swiper-scrollbar", draggable: true, dragsize: 200, }, breakpoints: { 1200: { slidesperview: 4, spacebetween: 50 }, 768: { slidesperview: 3, spacebetween: 20 }, 0: { slidesperview: 1, spacebetween: 0 }, } }); settimeout(function(){ $(".ctn6 .ctn6_more").css("height", $(".ctn6 .swiper-wrapper").height()) },500) ctn6.el.onmouseover = function () { ctn6.autoplay.stop(); } ctn6.el.onmouseout = function () { ctn6.autoplay.start(); } $(".ctn6 .swiper-slide").on("mouseover", function () { $(".ctn6 .swiper-slide").removeclass("swiper-slide-active") $(this).addclass("swiper-slide-active") }) $(".ctn6 .swiper-slide").on("onmouseout", function () { $(this).removeclass("swiper-slide-active") }); $(window).on('load', function () { new wow().init(); }); $('.ctn1,.ctn2,.ctn3,.ctn4').height($(window).height()) var ctn1_h = $('.ctn1').height() $(window).scroll(function () { var scrolltop = document.documentelement.scrolltop || document.body.scrolltop; if (scrolltop < ctn1_h) { $('.ctn2 .txt p').css('transform', 'scale(' + scrolltop / ctn1_h + ')') } var ctn4_t = $('.ctn3').offset().top + $('.ctn3').height() //console.log(ctn4_t,scrolltop) if (ctn4_t - scrolltop < 200) { $('.ctn4 .txt p,.ctn4 .txt .more,.ctn4 .txt span,.ctn4 .txt i').addclass('on') } else { $('.ctn4 .txt p,.ctn4 .txt .more,.ctn4 .txt span,.ctn4 .txt i').removeclass('on') } }) var timeline = new timelinemax(); timeline.fromto(".ctn2 .txt p", 3, { 'font-size': '120px' }, { 'font-size': '1200px' }) .addcallback(videopause) .fromto(".ctn2 .txt", .5, { opacity: 1 }, { opacity: 0, oncomplete: videoplay }) .to(".ctn2 .txt p", .5, { 'font-size': '1400px' }, 3) .to(".ctn2 .txt", 2.5, { opacity: 0 }) .addcallback(videotxtremove) .addcallback(videotxtadd) .to(".ctn2 .videotxt", 3, { opacity: 1 }) function videoplay () { $('.video video')[0].currenttime = 10.5 $('.video video')[0].play() } function videopause () { $('.video video')[0].currenttime = 10.5 $('.video video')[0].pause() } function videotxtadd () { $('.videotxt .p1,.videotxt .p2,.videotxt .p3').addclass('on') } function videotxtremove () { $('.videotxt .p1,.videotxt .p2,.videotxt .p3').removeclass('on') } let controller = new scrollmagic.controller(); let f_scene = new scrollmagic.scene({ triggerelement: ".ctn2", duration: "2500px",//滚动高度 triggerhook: 0, }) .setpin(".ctn2", {//需要固定的dom pushfollowers: true/*该属性可以用来设置是否看到运动的区域*/ }) .settween(timeline)//动画绑定到滚动条 //.addindicators() //查看debug .addto(controller) var sw_ctn4 = new swiper('.sw_ctn4', { loop: true, speed: 2000, autoplay: { delay: 2000,//1秒切换一次 }, fadeeffect: { crossfade: true, }, pagination: { el: '.swiper-pagination', }, navigation: { nextel: '.sw_ctn4 .swiper-button-next', prevel: '.sw_ctn4 .swiper-button-prev', }, on: { slidechangetransitionstart: function () { $('.ctn4 .sw_ctn4 .txt p,.ctn4 .sw_ctn4 .txt span,.ctn4 .sw_ctn4 .txt i,.ctn4 .sw_ctn4 .txt .more').removeclass('on') settimeout(() => { $('.ctn4 .sw_ctn4 .txt p,.ctn4 .sw_ctn4 .txt span,.ctn4 .sw_ctn4 .txt i,.ctn4 .sw_ctn4 .txt .more').addclass('on') }, 500); } } }); $('.ctn5 .txt_l .tab p').on('click', function () { var idx = $(this).index() $('.ctn5 .txt_l .tab p').eq(idx).addclass('on').siblings().removeclass('on') $('.ctn5 .txt_l .ctn .des').eq(idx).addclass('on').siblings().removeclass('on') $('.ctn5 .txt_l .ctn .des').eq(idx).fadein().siblings().fadeout() }) $('#modelbordercontainer').on('click', function () { $('#modelbordercontainer .s_tips').hide() }) $(window).scroll(function () { var totop = $(window).scrolltop(); if (totop >= "80") { $(".heade").slideup("1000") } else { $(".heade").slidedown("1000") } }); var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); var swiper = new swiper('.myswiper1', { autoplay: { delay: 5000 }, speed: 1000, slidesperview: 1, spacebetween: 0, effect: 'fade', loop: false, pagination: { el: '.myswiper1 .swiper-pagination', clickable: true, }, on: { init: function () { }, slidechangetransitionstart: function () { var _target = this; var curvideo = this.$el.find(".swiper-slide-active").find("video"); $(".myswiper1 .swiper-slide.swiper-slide-active").css("opacity", 1).siblings().css("opacity", 0); //暂停所有视频 function pauseall (ele) { ele.find("video").each(function () { $(this)[0].pause(); }); } pauseall(this.$el); //轮播间隔时间 _target.params.autoplay.delay = 5000; //判断当前激活元素是否有视频 if (curvideo.length > 0) { //console.log("有视频!"); this.autoplay.stop(); curvideo[0].currenttime = 0; curvideo[0].play(); curvideo[0].removeeventlistener('ended', function () { }, false); curvideo[0].addeventlistener('ended', function () { //console.log("视频播放结束!"); _target.slidenext(); }, false); } else { //console.log("无视频!"); _target.autoplay.start(); } }, slidechangetransitionend: function () { } } }); $(function () { if (!isfrontenv()) { $("body").addclass("act_ex") } })