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