Skip to content

Instantly share code, notes, and snippets.

@leviwheatcroft
Created July 31, 2014 15:54
Show Gist options
  • Save leviwheatcroft/a864a37c2b4a705c2dcf to your computer and use it in GitHub Desktop.
Save leviwheatcroft/a864a37c2b4a705c2dcf to your computer and use it in GitHub Desktop.
#test {
background-color: #000000;
background-image: url('http://placekitten.com/g/200/300');
display: block;
width: 200px;
height: 1000px;
}
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id='test'>
</div>
</body>
</html>
(function(jQuery) {
jQuery.fn.parallaxBackground = function(options) {
var defaults = {
offsetX: 0,
offsetY: 0,
ratio: 0.5
};
options = $.merge({}, defaults, options);
return $this;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment