Skip to content

Instantly share code, notes, and snippets.

@jakiestfu
Created September 10, 2012 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakiestfu/3693850 to your computer and use it in GitHub Desktop.
Save jakiestfu/3693850 to your computer and use it in GitHub Desktop.
Background Parallax for Metro-UI-CSS
var coefficient = 10;
$('.metro-scroll').scroll(function(e){
var bgpos = Math.floor((this.scrollLeft/coefficient)*-1) + 'px 0px';
$('body').css('background-position', bgpos);
});
@olton
Copy link

olton commented Sep 11, 2012

thanks. added in demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment