$(function () { var aniS0 = anime.timeline({autoplay: false}) aniS0.add({ targets: '.sc0 .fadeIn', opacity: [0,1], translateY: [50,0], easing: "easeOutSine", duration: 1000, delay: function(el, i) { return 150 * (i+1) } }) .add({ targets: '.sc0 .scaleIn', scale: [0,1], delay: function(el, i) { return 100 * (i+1) } }, '-=500') aniS0.play(); var aniS1 = anime.timeline({autoplay: false}) aniS1.add({ targets: '.sc1 .fadeIn', opacity: [0,1], translateY: [100,0], easing: "easeOutSine", duration: 1000, delay: function(el, i) { return 100 * (i+1) } }) .add({ targets: '.sc1 .scaleIn', scale: [0,1], delay: function(el, i) { return 100 * (i+1) } }, '-=500') var aniS2 = anime.timeline({autoplay: false}) aniS2.add({ targets: '.sc2 .fadeIn', opacity: [0,1], translateY: [100,0], easing: "easeOutSine", duration: 1000, delay: function(el, i) { return 100 * (i+1) } }) .add({ targets: '.sc2 .scaleIn', scale: [0,1], delay: function(el, i) { return 150 * (i+1) } }, '-=200') var aniS3 = anime.timeline({autoplay: false}) aniS3.add({ targets: '.sc3 .fadeIn', opacity: [0,1], translateY: [100,0], easing: "easeOutSine", duration: 1000, delay: function(el, i) { return 100 * (i+1) } }) .add({ targets: '.sc3 .scaleIn', scale: [0,1], delay: function(el, i) { return 150 * (i+1) } }, '-=200') $('#back').click(function(){ $(this).fadeOut(200); $('.sc1,.sc2,.sc3').removeClass('active').fadeOut(); }) $('#m1').click(function(){ $('.back').fadeIn(); $('.sc1').addClass('active').fadeIn(); aniS1.play(); }) $('#m2').click(function(){ $('.back').fadeIn(); $('.sc2').addClass('active').fadeIn(); aniS2.play(); }) $('#m3').click(function(){ $('.back').fadeIn(); $('.sc3').addClass('active').fadeIn(); aniS3.play(); }) $('.linkCTA').click(function(){ console.log("clickTag"); window.open(getTargetUrl(), "_blank"); }) })