diff --git a/scripts/jquery.parallax-1.1.3.js b/scripts/jquery.parallax-1.1.3.js index f3569dc..d42821e 100644 --- a/scripts/jquery.parallax-1.1.3.js +++ b/scripts/jquery.parallax-1.1.3.js @@ -19,7 +19,7 @@ http://www.gnu.org/licenses/gpl.html windowHeight = $window.height(); }); - $.fn.parallax = function(xpos, speedFactor, outerHeight) { + $.fn.parallax = function(xpos, speedFactor, alterHeightPosition, outerHeight) { var $this = $(this); var getHeight; var firstTop; @@ -59,7 +59,14 @@ http://www.gnu.org/licenses/gpl.html return; } - $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); + if(typeof alternHeightPosition != 'undefined') { + calc = firstTop - pos + alternHeightPosition; + } + else { + calc = firstTop - pos; + } + + $this.css('backgroundPosition', xpos + " " + Math.round((calc) * speedFactor) + "px"); }); }