Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated readme

commit bdcb08f5b6936d1920146ba7973112c3341eba8c 1 parent 86ca1df
@IanLunn authored
Showing with 1 addition and 62 deletions.
  1. +1 −1  README.markdown
  2. +0 −61 scripts/jquery.parallax-1.1.2.js
View
2  README.markdown
@@ -4,7 +4,7 @@ jQuery Parallax
jQuery Parallax is a script that simulates the parallax effect as seen on [nikebetterworld.com](http://www.nikebetterworld.com/).
Plugin: jQuery Parallax
-Version: 1.1.23
+Version: 1.1.3
Author: [Ian Lunn](http://www.ianlunn.co.uk/)
Twitter: [@IanLunn](http://www.twitter.com/IanLunn)
Demo: [jQuery Vertical Parallax Demo](http://www.ianlunn.co.uk/plugins/jquery-parallax/)
View
61 scripts/jquery.parallax-1.1.2.js
@@ -1,61 +0,0 @@
-/*
-Plugin: jQuery Parallax
-Version 1.1.2
-Author: Ian Lunn
-Author URL: http://www.ianlunn.co.uk/
-Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
-
-Dual licensed under the MIT and GPL licenses:
-http://www.opensource.org/licenses/mit-license.php
-http://www.gnu.org/licenses/gpl.html
-*/
-
-(function( $ ){
- var $window = $(window);
- var windowHeight = $window.height();
-
- $window.resize(function () {
- windowHeight = $window.height();
- });
-
- $.fn.parallax = function(xpos, adjuster, speedFactor, outerHeight) {
- var $this = $(this);
- var getHeight;
-
- if (outerHeight) {
- getHeight = function(jqo) {
- return jqo.outerHeight(true);
- };
- } else {
- getHeight = function(jqo) {
- return jqo.height();
- };
- }
-
- // setup defaults if arguments aren't specified
- if (arguments.length < 1 || xpos === null) xpos = "50%";
- if (arguments.length < 2 || adjuster === null) adjuster = 0;
- if (arguments.length < 3 || speedFactor === null) speedFactor = 0.1;
-
- // function to be called whenever the window is scrolled or resized
- function update(){
- var pos = $window.scrollTop();
-
- $this.each(function(){
- var $element = $(this);
- var top = $element.offset().top;
- var height = getHeight($element);
-
- // Check if totally above or totally below viewport
- if (top + height < pos || top > pos + windowHeight) {
- return;
- }
-
- $this.css('backgroundPosition', xpos + " " + Math.round((adjuster - pos + top) * speedFactor) + "px");
- });
- }
-
- $window.bind('scroll', update).resize(update);
- update();
- };
-})( jQuery );
Please sign in to comment.
Something went wrong with that request. Please try again.