/** * parallaxing - A jQuery plugin for creating parallax backgrounds. * @version v1.0.0 * @link * @author Bc. Martin Tesaƙ * @license The MIT License (MIT) **/ !function(a){var i=a(window);a.fn.parallaxing=function(){var t,n,o="parallaxing-"+Math.round((new Date).getTime()+100*Math.random()),r=this.outerWidth(),l="0",e=this.attr("data-parallaxing-img"),s=this.outerHeight(),d=0,p=this.attr("data-parallaxing-speed"),h=this.attr("data-parallaxing-bleed"),x=i.scrollTop(),g=this.offset().top-x;return this.attr("data-parallaxing-id",o),void 0!==p&&!1!==p&&a.isNumeric(p)&&p<=1&&p>=0&&(d=p),void 0!==h&&!1!==h&&(l=h),this.css({display:"flex","box-sizing":"border-box","flex-wrap":"wrap"}),t=-1*(g+-1*g*d),n='
',a("body").prepend(n)},a("[data-parallaxing]").each(function(){a(this).parallaxing()}),i.on("scroll",function(){a.parallaxingFollow()}),a.parallaxingFollow=function(){a(".parallaxing-window").each(function(){var t,n=i.scrollTop(),o=a(this).attr("id"),r=0,l=a("[data-parallaxing-id='"+o+"']"),e=l.offset().top-n,s=l.attr("data-parallaxing-speed");a(this).css("top",e),void 0!==s&&!1!==s&&a.isNumeric(s)&&s<=1&&s>=0&&(r=s),t=-1*(e+-1*e*r),a(this).find("div").css("top",t)})},a(window).on("resize",function(){a.parallaxingResize()}),a.parallaxingResize=function(){a(".parallaxing-window").each(function(){var i=a(this).attr("id"),t=a("[data-parallaxing-id='"+i+"']"),n=t.outerWidth(),o=t.position().left,r=t.outerHeight();a(this).width(n),a(this).height(r),a(this).css("left",o+"px")})},a.fn.parallaxingDestroy=function(){var i=this.attr("data-parallaxing-id");this.removeAttr("data-parallaxing-id"),this.removeAttr("style"),a("#"+i).remove()}}(jQuery);