/*! * parallax.js v1.5.0 (http://pixelcog.github.io/parallax.js/) * @copyright 2016 PixelCog, Inc. * @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE) */ !function(d,p,f,h){!function(){for(var o=0,t=["ms","moz","webkit","o"],i=0;i").prependTo(this.mirrorContainer);var o=this.$element.find(">.parallax-slider"),r=!1;0==o.length?this.$slider=d("").prependTo(this.$mirror):(this.$slider=o.prependTo(this.$mirror),r=!0),this.$mirror.addClass("parallax-mirror").css({visibility:"hidden",zIndex:this.zIndex,position:"fixed",top:0,left:0,overflow:"hidden"}),this.$slider.addClass("parallax-slider").one("load",function(){e.naturalHeight&&e.naturalWidth||(e.naturalHeight=this.naturalHeight||this.height||1,e.naturalWidth=this.naturalWidth||this.width||1),e.aspectRatio=e.naturalWidth/e.naturalHeight,m.isSetup||m.setup(),m.sliders.push(e),m.isFresh=!1,m.requestRender()}),r||(this.$slider[0].src=this.imageSrc),(this.naturalHeight&&this.naturalWidth||this.$slider[0].complete||0=this.boxWidth?(this.imageWidth=r*this.aspectRatio|0,this.imageHeight=r,this.offsetBaseTop=h,t=this.imageWidth-this.boxWidth,"left"==this.positionX?this.offsetLeft=0:"right"==this.positionX?this.offsetLeft=-t:isNaN(this.positionX)?this.offsetLeft=-t/2|0:this.offsetLeft=Math.max(this.positionX,-t)):(this.imageWidth=this.boxWidth,this.imageHeight=this.boxWidth/this.aspectRatio|0,this.offsetLeft=0,t=this.imageHeight-r,"top"==this.positionY?this.offsetBaseTop=h:"bottom"==this.positionY?this.offsetBaseTop=h-t:isNaN(this.positionY)?this.offsetBaseTop=h-t/2|0:this.offsetBaseTop=h+Math.max(this.positionY,-t))},render:function(){var t=m.scrollTop,i=m.scrollLeft,e=this.overScrollFix?m.overScroll:0,s=t+m.winHeight;this.boxOffsetBottom>t&&this.boxOffsetTop<=s?(this.visibility="visible",this.mirrorTop=this.boxOffsetTop-t,this.mirrorLeft=this.boxOffsetLeft-i,this.offsetTop=this.offsetBaseTop-this.mirrorTop*(1-this.speed)):this.visibility="hidden",this.$mirror.css({transform:"translate3d("+this.mirrorLeft+"px, "+(this.mirrorTop-e)+"px, 0px)",visibility:this.visibility,height:this.boxHeight,width:this.boxWidth}),this.$slider.css({transform:"translate3d("+this.offsetLeft+"px, "+this.offsetTop+"px, 0px)",position:"absolute",height:this.imageHeight,width:this.imageWidth,maxWidth:"none"})}}),d.extend(m,{scrollTop:0,scrollLeft:0,winHeight:0,winWidth:0,docHeight:1<<30,docWidth:1<<30,sliders:[],isReady:!1,isFresh:!1,isBusy:!1,setup:function(){if(!this.isReady){var t,i,e,s=this,o=d(f),r=d(p),h=function(){m.winHeight=r.height(),m.winWidth=r.width(),m.docHeight=o.height(),m.docWidth=o.width()},a=function(){var t=r.scrollTop(),i=m.docHeight-m.winHeight,e=m.docWidth-m.winWidth;m.scrollTop=Math.max(0,Math.min(i,t)),m.scrollLeft=Math.max(0,Math.min(e,r.scrollLeft())),m.overScroll=Math.max(t-i,Math.min(t,0))},n=this.scrollListener=function(){a(),m.requestRender()};r.on("resize.px.parallax load.px.parallax",function(){h(),s.refresh(),m.isFresh=!1,m.requestRender()}).on("scroll.px.parallax load.px.parallax",n),t=p,i="touchmove",e=n,c?t.addEventListener(i,e,{passive:!0}):t.addEventListener(i,e),h(),a(),this.isReady=!0;var l=-1;!function t(){if(l==p.pageYOffset)return p.requestAnimationFrame(t),!1;l=p.pageYOffset,s.render(),p.requestAnimationFrame(t)}()}},configure:function(t){"object"==typeof t&&(delete t.refresh,delete t.render,d.extend(this.prototype,t))},refresh:function(){d.each(this.sliders,function(){this.refresh()}),this.isFresh=!0},render:function(){this.isFresh||this.refresh(),d.each(this.sliders,function(){this.render()})},requestRender:function(){this.render(),this.isBusy=!1},destroy:function(t){var i,e,s,o,r=d(t).data("px.parallax");for(r.$mirror.remove(),i=0;i