Skip to content

Instantly share code, notes, and snippets.

@cheh
Created February 4, 2014 08:33
Show Gist options
  • Save cheh/8800038 to your computer and use it in GitHub Desktop.
Save cheh/8800038 to your computer and use it in GitHub Desktop.
Slow down background image scroll speed
jQuery( document ).ready( function( $ ) {
var body = document.body,
doc = document.documentElement;
$(window).scroll(function () {
body.style.backgroundPosition = "0px " + ( 830 -(Math.max(doc.scrollTop, body.scrollTop) / 4) ) + "px";
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment