方块排序游戏
时间:2006-03-17 来源:22/2
要完成此效果需要三个步骤
第一步:把如下代码加入到<head>区域中
第二步:把如下代码加入到<body>区域中 <center>
<table border=0 celpadding=0 cellspacing=0>
<tr><td>
<form>
<div align="center">
<input type="button" value=" 1 " onClick="window.move(0)">
<input type="button" value=" 2 " onClick="window.move(1)">
<input type="button" value=" 3 " onClick="window.move(2)">
<br>
<input type="button" value=" 4 " onClick="window.move(3)">
<input type="button" value=" 5 " onClick="window.move(4)">
<input type="button" value=" 6 " onClick="window.move(5)">
<br>
<input type="button" value=" 7 " onClick="window.move(6)">
<input type="button" value=" 8 " onClick="window.move(7)">
<input type="button" value=" 0 " onClick="window.move(8)">
</div>
<p align="center"> 移动步数<br>
<input name="moves" size=7 value=" 0 ">
<p align="center">
<input type="submit" value="New Game" onClick="window.newgame()">
</form>
</td></table>
<p><font color="#33FF33">移动方块使数字依次排列</font>
第三步:把“onLoad="window.newgame()"”加在<body>标记里
例如:<body onLoad="window.newgame()">
第二步:把如下代码加入到<body>区域中 <center>
<table border=0 celpadding=0 cellspacing=0>
<tr><td>
<form>
<div align="center">
<input type="button" value=" 1 " onClick="window.move(0)">
<input type="button" value=" 2 " onClick="window.move(1)">
<input type="button" value=" 3 " onClick="window.move(2)">
<br>
<input type="button" value=" 4 " onClick="window.move(3)">
<input type="button" value=" 5 " onClick="window.move(4)">
<input type="button" value=" 6 " onClick="window.move(5)">
<br>
<input type="button" value=" 7 " onClick="window.move(6)">
<input type="button" value=" 8 " onClick="window.move(7)">
<input type="button" value=" 0 " onClick="window.move(8)">
</div>
<p align="center"> 移动步数<br>
<input name="moves" size=7 value=" 0 ">
<p align="center">
<input type="submit" value="New Game" onClick="window.newgame()">
</form>
</td></table>
<p><font color="#33FF33">移动方块使数字依次排列</font>
第三步:把“onLoad="window.newgame()"”加在<body>标记里
例如:<body onLoad="window.newgame()">
相关阅读 更多 +