少しだけ遊んでね
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><SCRIPT id=code> var timerID function StopBackground() { clearTimeout(timerID) } function AnimateBackground(hPos,vPos,hInc,vInc,delay) { if (arguments[5]) document.body.style.backgroundImage = "url(\"" + arguments[5] + "\")" if (arguments[6]) document.body.style.backgroundRepeat = arguments[6] if (!isNaN(hPos)) { if ((hInc!=0) && (hPos>0)) hPos=-100000 hPos+=hInc } if (!isNaN(vPos)) { if ((vInc!=0) && (vPos>0)) vPos=-100000 vPos+= vInc } document.body.style.backgroundPosition= hPos + " " + vPos if (isNaN(hPos)) hPos = "\"" + hPos + "\"" if (isNaN(vPos)) vPos = "\"" + vPos + "\"" timerID = setTimeout("AnimateBackground("+hPos+","+vPos+","+hInc+","+vInc+","+delay+")",delay) } AnimateBackground(0,0,-1,0,10) </SCRIPT></DIV> |
左方向 | -1 | 0 | |
右方向 | 1 | 0 | |
真下方向 | 0 | 1 | |
真上方向 | 0 | -1 | |
左斜め上方向 | -1 | -1 | |
右斜め下方向 | 1 | 1 | |
右斜め上方向 | 1 | -1 | |
左斜め下方向 | -1 | 1 |