 <p>With this code</p> <pre><code>window.onscroll = function (event) { var amount = window.pageYOffset + "px"; document.getElementById("cover").style.left = amount; } </code></pre> <p>You can achieve it.</p> <p>Working Fiddle: <a href="http://jsfiddle.net/sLse3fez/" rel="nofollow">Fiddle</a></p>