// window.onbeforeunload = function () { // $(window).scrolltop(0) // } document.addeventlistener("weixinjsbridgeready", function () { $('video').each(function (index, item) { item.play(); }) }, false); function homenext() { $(window).scrolltop(0) $('.logo-animate-home').addclass('play'); settimeout(function () { $('.logo-animate-home .item').eq(0).addclass('play'); }, 800) settimeout(function () { $('.logo-animate-home .item').eq(1).addclass('play'); }, 850) settimeout(function () { $('.logo-animate-home .item').eq(2).addclass('play'); settimeout(function () { $('.logo-animate-home').remove(); }, 1000) }, 900) settimeout(function () { if ($('.banner video').length > 0) { $('.banner video').get(0).currenttime = 0; $('.banner .bg').css({ opacity: 0 }) $('.banner video').get(0).addeventlistener("ended", function () { $('.banner .bg').animate({ opacity: 1 }, 1500) $('.banner .logo').addclass('play') }); settimeout(function () { $('.banner .text').addclass('play'); }, 700) } }, 600) } $(function () { settimeout(function () { homenext(); }, 500) $('.modular1 .bgs .item').each(function (index, item) { $(item).attr('slot', index) }) $('.modular3 .right video').each(function (index, item) { $(item).attr('slot', index) }) $('.modular1 .bgs .item').parent().append($('.modular1 .bgs .item.active')) $('.modular3 .right video').parent().append($('.modular3 .right video.on')) $('.modular1 li').hover(function () { $(this).addclass('active').siblings().removeclass('active'); if ($('.modular1 .bgs .item[slot="' + $(this).index() + '"]').index() !== $('.modular1 .bgs .item').length - 1) { $('.modular1 .bgs .item[slot="' + $(this).index() + '"]').parent().append($('.modular1 .bgs .item[slot="' + $(this).index() + '"]')) } $('.modular1 .bgs .item[slot="' + $(this).index() + '"]').addclass('active').siblings().removeclass('active'); }, function () { }) if ($(window).width() < 1024) { $('.modular3 .right a').click(function () { $(this).addclass('on').siblings().removeclass('on'); var index = $(this).parent().find('a').index($(this).parent().find(this)); var video = $(this).parents('.right').find('video[slot="' + index + '"]').get(0); if ($('.modular3 .right video[slot="' + index + '"]').index() !== $('.modular3 .right video').length - 1) { $('.modular3 .right video').parent().append($('.modular3 .right video[slot="' + index + '"]')) video.currenttime = 0; video.play(); } $(this).parents('.right').find('video[slot="' + index + '"]').addclass('on').siblings().removeclass('on'); }) } else { $('.modular3 .right a').hover(function () { $(this).addclass('on').siblings().removeclass('on'); var index = $(this).parent().find('a').index($(this).parent().find(this)); var video = $(this).parents('.right').find('video[slot="' + index + '"]').get(0); if ($('.modular3 .right video[slot="' + index + '"]').index() !== $('.modular3 .right video').length - 1) { $('.modular3 .right video').parent().append($('.modular3 .right video[slot="' + index + '"]')) video.currenttime = 0; video.play(); } $(this).parents('.right').find('video[slot="' + index + '"]').addclass('on').siblings().removeclass('on'); }, function () { }) // pc加入场延迟 delayplay('.modular1 li', 0.2) delayplay('.modular2 .item', 0.1) delayplay('.modular2 .item.list a', 0.1) delayplay('.modular3 .item', 0.2) } scolltext($('.modular1 li .text')) }) // 延迟播放动画 function delayplay(el, time) { $(el).each(function (index, item) { $(item).attr('data-wow-delay', time * index + 's'); }) } function scolltext (obj) { if ($(obj).length > 0) { $(obj).mcustomscrollbar({ scrollinertia: 0, mousewheelpixels: 0, autodraggerlength: true, advanced: { autoscrollonfocus: "" } }); } }