$(window).scroll(function(e){ parallax(); }); function parallax(){ var scrolled = $(window).scrollTop(); $('.bg').css('top',-(scrolled*0.2)+'px'); }
.bg { background: url('http://i.imgur.com/USFbNpC.jpg') repeat; position: fixed; width: 100%; height: 300%; top:0; left:0; z-index: -1; } section { color: #fff; font-family: arial; width: 500px; margin: auto; line-height: 20px; font-size: 16px; }