/*! * Name : Just Another Parallax [Jarallax] * Version : 1.1.0 * Author : _nK http://nkdev.info * GitHub : https://github.com/nk-o/jarallax */ (function(e){"function"===typeof define&&define.amd?define(["jquery"],e):"undefined"!==typeof exports?module.exports=e(require("jquery")):e(jQuery)})(function(e){Date.now||(Date.now=function(){return(new Date).getTime()});window.requestAnimationFrame||function(){for(var b=["webkit","moz"],a=0;a").css(c).css({visibility:"hidden","z-index":a.options.zIndex}).attr("id","jarallax-container-"+a.instanceID).prependTo(a.$item);a.image.useImgTag&&l?(a.image.$item=e("").attr("src",a.image.src),d=e.extend({"max-width":"none"},c,d)):(a.image.$item= e("
"),d=e.extend({"background-position":"50% 50%","background-repeat":"no-repeat no-repeat","background-image":'url("'+a.image.src+'")'},c,d));a.image.$item.css(d).prependTo(a.image.$container);a.image.width&&a.image.height?b():a.getImageSize(a.image.src,function(c,d){a.image.width=c;a.image.height=d;b()})};f.prototype.destroy=function(){for(var b=0,a=h.length;b'),c=e("head #jarallax-clip-"+this.instanceID));b=["#jarallax-container-"+this.instanceID+" {"," clip: rect(0px "+b+"px "+a+"px 0);"," clip: rect(0px, "+b+"px, "+a+"px, 0);","}"].join("\n");c[0].styleSheet?c[0].styleSheet.cssText=b:c.html(b)};f.prototype.coverImage=function(){if(this.image.width&&this.image.height){var b=this.image.$container.outerWidth(!0),a=this.image.$container.outerHeight(!0), c=e(window).outerWidth(!0),d=e(window).outerHeight(!0),g=this.image.width,f=this.image.height,d={width:Math.max(c,b)*Math.max(this.options.speed,1),height:Math.max(d,a)*Math.max(this.options.speed,1)};d.width/d.height>g/f?(c=d.width,g=d.width*f/g):(c=d.height*g/f,g=d.height);this.image.useImgTag&&l?(d.width=this.round(c),d.height=this.round(g),d.marginLeft=this.round(-(c-b)/2),d.marginTop=this.round(-(g-a)/2)):d.backgroundSize=this.round(c)+"px "+this.round(g)+"px";this.image.$item.css(d)}};f.prototype.onScroll= function(b){if(this.image.width&&this.image.height){var a=e(window).scrollTop(),c=e(window).scrollLeft();e(window).width();var d=e(window).height(),g=this.$item.offset().top,f=this.$item.offset().left,h=this.$item.outerHeight(!0),k={visibility:"visible",backgroundPosition:"50% 50%"};(b?0:g+ha+d)||(b=-(a-g)*this.options.speed,c=-(c-f)*this.options.speed,b=this.round(b),c=this.round(c),l&&this.options.enableTransform?(k.transform="translateY("+b+"px) translateX("+c+"px)",m&&(k.transform="translate3d("+ c+"px, "+b+"px, 0)")):k.backgroundPosition=c+"px "+b+"px",this.image.$item.css(k))}};(function(){e(window).on("scroll.jarallax",function(){window.requestAnimationFrame(function(){for(var a=0,b=h.length;a