Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Cleaned up code, fix a couple bugs #1

Merged
merged 3 commits into from
Jun 11, 2012
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updating to 1.1.2 (partially)
  • Loading branch information
fidian committed May 8, 2012
commit c975568202e6969542bb631e96c5e6e521899899
10 changes: 8 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.1
Version: 1.1.2
Author: [Ian Lunn](http://www.ianlunn.co.uk/)
Demo: [jQuery Vertical Parallax Demo](http://www.ianlunn.co.uk/plugins/jquery-parallax/)
Tutorial: [Nikebetterworld Parallax Effect Demo](http://www.ianlunn.co.uk/blog/code-tutorials/recreate-nikebetterworld-parallax/)
Expand All @@ -16,4 +16,10 @@ http://www.gnu.org/licenses/gpl.html
Updates
-------

26/10/2011 - Updated to work with jQuery 1.6.4
8/5/2012 - Fixed height/outerHeight parameter
- Smoother effect when scrolling
- Fixed positioning with scaled backgrounds
- Reduced code
- Now passes jsl 0.3.0 without warnings

26/10/2011 - Updated to work with jQuery 1.6.4
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>jQuery Parallax Plugin Demo</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery.parallax-1.1.js"></script>
<script type="text/javascript" src="scripts/jquery.parallax-1.1.2.js"></script>
<script type="text/javascript" src="scripts/jquery.localscroll-1.2.7-min.js"></script>
<script type="text/javascript" src="scripts/jquery.scrollTo-1.4.2-min.js"></script>
<script type="text/javascript">
Expand Down
16 changes: 5 additions & 11 deletions scripts/jquery.parallax-1.1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Plugin: jQuery Parallax
Version 1.1
Version 1.1.2
Author: Ian Lunn
Author URL: http://www.ianlunn.co.uk/
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
Expand Down Expand Up @@ -33,15 +33,9 @@ http://www.gnu.org/licenses/gpl.html
}

// 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
}
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(){
Expand All @@ -63,5 +57,5 @@ http://www.gnu.org/licenses/gpl.html

$window.bind('scroll', update).resize(update);
update();
}
};
})( jQuery );
4 changes: 2 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Plugin: jQuery Parallax
Version 1.1
Version 1.1.2
Author: Ian Lunn
Author URL: http://www.ianlunn.co.uk/
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
Expand Down Expand Up @@ -132,4 +132,4 @@ h2{
padding: 100px 0 0 0;
position: relative;
width: 350px;
}
}