$(function () { var pagew_in = $(document).outerWidth(true) + (window.innerWidth - document.body.clientWidth); var pageh_in = $(window).innerHeight(); $(window).on("resizeEnd", function (event) { repage_index(); }); try { if (pagew > 1023) { var in01_y = 0; var p1conter = new ScrollMagic.Controller(); new ScrollMagic.Scene({ triggerElement: ".in_01", triggerHook: 0, duration: "30%" }) .setPin(".in01fr") .on("progress", function (e) { var pro = e.progress; //console.log(pro); if (pro < 0.4) { in01_y = pro * 24; $(".in01c_bg .b1").css({ "transform": "translate(0%," + in01_y + "%) scale(" + (1 + pro * 2.5) + ")" }); $(".in01c_bg").css({ "opacity": "1" }); $(".in01_bg .m-video").css({ "display": "none" }); } else if (pro < .7) { $(".in01c_bg .b1").css({ "transform": "translate(0%," + in01_y + "%) scale(" + (1 + pro * 2.5) + ")" }); $(".in01c_bg").css({ "opacity": (1.5 - pro) }); $(".in01_bg .m-video").css({ "display": "none" }); } else { $(".in01c_bg").css({ "opacity": (.9 - pro) }); $(".in01_bg .m-video").css({ "display": "block" }); } $(".in_01 .in01_c .txt").css({ "transform": "translate(0%," + (pro * 100) + "%)", "opacity": (1 - pro) }); }) //.addIndicators() .addTo(p1conter); } var in01video = document.getElementById("in01video"); $(".m-video222").click(function () { in01video.play(); $(this).css({"display":"none"}); }); } catch (e) { } repage_index(); function repage_index() { pagew = $(document).outerWidth(true) + (window.innerWidth - document.body.clientWidth); pageh = $(window).innerHeight(); } });