????

Your IP : 13.58.147.19


Current Path : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/js/lib/
Upload File :
Current File : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/js/lib/scrolly.js

!function(t,e,i,s){function o(e,i){this.$element=t(e),this.init()}var n="scrolly2";o.prototype.init=function(){var i=this;this.startPosition=0,this.offsetTop=this.$element.offset().top,this.height=this.$element.outerHeight(!0),this.velocity=this.$element.attr("data-velocity"),this.direction=this.$element.attr("data-direction"),t(e).bind("scroll",function(){i.scrolly2()})},o.prototype.scrolly2=function(){var i=t(e).scrollTop()-20,s=t(e).scrollTop()+t(e).height()+20,o=this.$element.offset().top,n=this.$element.offset().top+this.$element.height();if(!(o>=s||i>=n)){this.$element.offset().top>t(e).height()&&"none"!==this.direction&&(this.startPosition=(this.$element.offset().top-t(e).height())*Math.abs(this.velocity));var h=this.startPosition+t(e).scrollTop()*this.velocity,l="50%",c="50%";if("left"===this.direction)l=h+"px";else if("right"===this.direction)l="calc(100% + "+-h+"px)";else if("down"===this.direction){var r=-(t(e).height()-this.$element.offset().top-this.$element.height()-parseInt(this.$element.css("paddingTop"))-parseInt(this.$element.css("paddingBottom")));c="calc(100% + "+(r-t(e).scrollTop()-h)+"px)"}else c=this.$element.offset().top-t(e).scrollTop()+h+"px";this.$element.css({backgroundPosition:l+" "+c})}},t.fn[n]=function(e){return this.each(function(){t.data(this,"plugin_"+n)||t.data(this,"plugin_"+n,new o(this,e))})}}(jQuery,window,document);