語法展示:: http://home.graffiti.net/trfgfdzgds/
畫面會抖動喔
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript1.2">
<!--
var quakeID=0;
var deltaX=0;
var deltaY=0;
function tremor(dir) { // -10 to 10
with(Math) return ceil(random()*10)*2*(floor(random()*2)-.5);
}
function winQuake() {
clearTimeout(quakeID);
for (i=0;i<=((Math.random()*35)+5);i++) {
xShift = tremor();
yShift = tremor();
window.moveBy(xShift,yShift);
deltaX -= xShift;
deltaY -= yShift;
}
winReset();
quakeID=setTimeout("winQuake()",Math.ceil(Math.random()*3500)+250);
}
function winReset() {
window.moveBy(deltaX,deltaY);
deltaX=0; deltaY=0;
}
window.onload=winQuake;
window.onunload=winReset;
-->
</script>
<center>
<a href="JavaScript:if(window.quakeID)clearTimeout(quakeID)">停止</a>
<br><br>
<a href="JavaScript:if(window.winQuake)winQuake()">再試一次!</a>
</center>
將以下程式碼複製,貼在<body >標籤裡面。
onload="restart()"
留言列表