/********************************************* * appli.js --------------------------------------------- @init @plugin * - ppliAnimation *********************************************/ /* ------------------------------------------- * @init ------------------------------------------- */ j$(function(){ j$.modal(); j$(window).on('load', function(){ j$.appliAnimation(); }); }); /* ------------------------------------------- * @plugin ------------------------------------------- */ (function(j$){ var u = new EPOS_CARD.Util(); j$.appliAnimation = function(){ if(j$('.js-appliAnimation').length === 0){ return false; } var appliAddclass = function() { var wHeight = j$(window).height(); var scrollAmount = j$(window).scrollTop(); var animationPoint = (u.isRangeSP()) ? 100 : 250; j$('.js-appliAnimation').each(function () { var targetPosition = j$(this).offset().top; if(scrollAmount > targetPosition - wHeight + animationPoint) { j$(this).addClass("is-active"); } }); }; appliAddclass(); j$(window).scroll(function () { appliAddclass(); }); }; /* * modal */ j$.modal = function(config){ // vars var $elm = j$(".js-appli_modal"); if($elm.length === 0){ return false; } var c = j$.extend({ customClose: ".cb_close", CLOSE_HTML: '
' },config); if(u.isRangeSP()){ $elm.colorbox({ iframe: true, innerWidth:"95%", innerHeight: 250, maxWidth: "95%", maxHeight: "98%", fixed: true, className: "cb-ytWrap", closeButton: false, onComplete: function(){ j$(c.CLOSE_HTML).appendTo("#colorbox.cb-ytWrap #cboxLoadedContent"); }, onClosed: function(){ j$("#ytClose").remove(); } }); } else { $elm.colorbox({ iframe: true, innerWidth:980, innerHeight:580, maxWidth: "100%", maxHeight: "100%", fixed: true, className: "cb-ytWrap", closeButton: false, onComplete: function(){ j$(c.CLOSE_HTML).appendTo("#colorbox.cb-ytWrap #cboxWrapper"); }, onClosed: function(){ j$("#ytClose").remove(); } }); } }; })(jQuery);