简单的网页背景滚动视觉差特效 simple background parallax scrolling in javascript

Simple background parallax scrolling in JavaScript:
function parallax() {
  window.onscroll = function() {
    var speed = 5.0;
    document.body.style.backgroundPosition = (-window.pageXOffset/speed)+"px "+(-window.pageYOffset/speed)+"px";
  }
}