diff --git a/package.json b/package.json new file mode 100644 index 0000000..b97ca6f --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "jquery-parallax", + "version": "1.0.1", + "description": " Used to recreate the Nike Better World parallax effect", + "main": "scripts/jquery.parallax-1.1.3.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/IanLunn/jQuery-Parallax.git" + }, + "author": "Ian Lunn", + "license": "MIT", + "bugs": { + "url": "https://github.com/IanLunn/jQuery-Parallax/issues" + }, + "homepage": "https://github.com/IanLunn/jQuery-Parallax#readme" +} diff --git a/scripts/jquery.parallax-1.1.3.js b/scripts/jquery.parallax-1.1.3.js index f3569dc..7b24486 100644 --- a/scripts/jquery.parallax-1.1.3.js +++ b/scripts/jquery.parallax-1.1.3.js @@ -10,8 +10,15 @@ Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html */ - -(function( $ ){ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('jquery')); + } else { + factory(root.jQuery); + } +}(this, function ($) { var $window = $(window); var windowHeight = $window.height(); @@ -66,4 +73,4 @@ http://www.gnu.org/licenses/gpl.html $window.bind('scroll', update).resize(update); update(); }; -})(jQuery); +}));