/*! * parallax.js v1.2.1 (http://pixelcog.github.io/parallax.js/) * Copyright (c) 2014 PixelCog, Inc. * Licensed under MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE) */ (function($,window,document,undefined){(function(){var lastTime=0;var vendors=["ms","moz","webkit","o"];for(var x=0;x").prependTo("body");this.$slider=$("").prependTo(this.$mirror);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(){if(!self.naturalHeight||!self.naturalWidth){self.naturalHeight=this.naturalHeight||this.height||1;self.naturalWidth=this.naturalWidth||this.width||1}self.aspectRatio=self.naturalWidth/self.naturalHeight;Parallax.isSetup||Parallax.setup();Parallax.sliders.push(self);Parallax.isFresh=false;Parallax.requestRender()});this.$slider[0].src=this.imageSrc;if(this.naturalHeight&&this.naturalWidth||this.$slider[0].complete){this.$slider.trigger("load")}}$.extend(Parallax.prototype,{speed:.2,bleed:0,zIndex:-100,iosFix:true,androidFix:true,position:"center",refresh:function(){this.boxWidth=this.$element.outerWidth();this.boxHeight=this.$element.outerHeight()+this.bleed*2;this.boxOffsetTop=this.$element.offset().top-this.bleed;this.boxOffsetLeft=this.$element.offset().left;this.boxOffsetBottom=this.boxOffsetTop+this.boxHeight;var margin=0;var winHeight=Parallax.winHeight;var imageHeightMin=winHeight-(winHeight-this.boxHeight)*this.speed|0;if(imageHeightMin*this.aspectRatio>=this.boxWidth){this.imageWidth=imageHeightMin*this.aspectRatio|0;this.imageHeight=imageHeightMin;this.offsetBaseTop=0;margin=this.imageWidth-this.boxWidth;if(this.positionX=="left"){this.offsetLeft=0}else if(this.positionX=="right"){this.offsetLeft=-margin}else if(!isNaN(this.positionX)){this.offsetLeft=Math.max(this.positionX,-margin)}else{this.offsetLeft=-margin/2|0}}else{this.imageWidth=this.boxWidth;this.imageHeight=this.boxWidth/this.aspectRatio|0;this.offsetLeft=0;margin=this.imageHeight-imageHeightMin;if(this.positionY=="top"){this.offsetBaseTop=0}else if(this.positionY=="bottom"){this.offsetBaseTop=-margin}else if(!isNaN(this.positionY)){this.offsetBaseTop=Math.max(this.positionY,-margin)}else{this.offsetBaseTop=-margin/2|0}}},render:function(){var scrollTop=Parallax.scrollTop;var scrollLeft=Parallax.scrollLeft;var scrollBottom=scrollTop+Parallax.winHeight;if(this.boxOffsetBottom>scrollTop&&this.boxOffsetTop