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

在iframe中演示效果有一些问题,你可以下载到本地查看演示效果!

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";
  }
}