JavaScript网页版趣味拼图游戏

编程入门 行业动态 更新时间:2024-10-07 07:33:06

JavaScript网页版<a href=https://www.elefans.com/category/jswz/34/1768737.html style=趣味拼图游戏"/>

JavaScript网页版趣味拼图游戏

页版趣味拼图游戏 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>JS趣味拼图</title> </head> <body> <p align="center"><br> <font color="#800000"><big><big><big><big><big><big><strong>趣味拼图</strong></big></big></big></big></big></big></font></p> <dl> <dd align="right"><table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="50%"><table border="1" width="67%" height="127" cellspacing="0" cellpadding="0"> <tr> <td width="20%" align="left" height="95"><img src="../a" onMouseDown="MoveImage(0,0,1,0,4)" width="95" height="95"></td> <td width="20%" align="left" height="95"><img src="../a" onMouseDown="MoveImage(1,1,1,0,4)" width="95" height="95"></td> <td width="20%" align="left" height="95"><img src="../a" onMouseDown="MoveImage(2,1,1,0,4)" width="95" height="95"></td> <td width="20%" align="left" height="95"><img src="../a" onMouseDown="MoveImage(3,1,0,0,4)" width="95" height="95"></td> <td width="20%" align="left" height="143" rowspan="2"><dl> <dt><font color="#FF0000">规则:</font></dt> </dl> <p><font color="#0000FF">当一幅图片旁边有空白区时可单击此图片便之移动,直到左边12幅小图片组合成右边的图像为止</font>。</td> </tr> <tr> <td width="20%" align="left" height="48"><img src="../a" onMouseDown="MoveImage(4,0,1,4,4)" width="95" height="95"></td> <td width="20%" align="left" height="48"><img src="../a" onMouseDown="MoveImage(5,1,1,4,4)" width="95" height="95"></td> <td width="20%" align="left" height="48"><img src="../a" onMouseDown="MoveImage(6,1,1,4,4)" width="95" height="95"></td> <td width="20%" align="left" height="48"><img src="../a" onMouseDown="MoveImage(7,1,0,4,4)" width="95" height="95"></td> </tr> <tr> <td width="20%" align="left" height="1"><img src="../a" onMouseDown="MoveImage(8,0,1,4,0)" width="95" height="95"></td> <td width="20%" align="left" height="1"><img src="../a" onMouseDown="MoveImage(9,1,1,4,0)" width="95" height="95"></td> <td width="20%" align="left" height="1"><img src="../a" onMouseDown="MoveImage(10,1,1,4,0)" width="95" height="95"></td> <td width="20%" align="left" height="1"><img src="../a" onMouseDown="MoveImage(11,1,1,4,0)" width="95" height="95"></td> <td width="20%" align="left" height="1"><img src="../a" onMouseDown="MoveImage(12,1,0,0,0)" width="95" height="95"></td> </tr> </table> </td> <td width="50%"><img src=".JPG" WIDTH="227" HEIGHT="170"><dl> <div align="center"><center> <dt><font face="隶书" color="#FF0000"><big><big><big><big><big><big><big><big>样图</big></big></big></big></big></big></big></big></font></dt> </center></div> </dl> </td> </tr> </table> <p><br> </p> </dd> <script> index=new Array(1,1,1,1,1,1,1,1,1,1,1,1,0); for(i=0;i<13;i++){ document.images[i].src=""+i+".JPG"; } function MoveImage(imageIndex,D1,D2,D3,D4){ if(index[imageIndex-D1]==0)moveTo(imageIndex,imageIndex-D1); if(index[imageIndex+D2]==0)moveTo(imageIndex,imageIndex+D2); if(index[imageIndex-D3]==0)moveTo(imageIndex,imageIndex-D3); if(index[imageIndex+D4]==0)moveTo(imageIndex,imageIndex+D4); } function moveTo(image1,image2){ Img=new Image(); Img.src=document.images[image2].src document.images[image2].src=document.images[image1].src; document.images[image1].src=Img.src; index[image2]=1; index[image1]=0; } </script> </dl> </body> </html>

更多推荐

JavaScript网页版趣味拼图游戏

本文发布于:2024-03-13 18:31:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1734564.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:趣味   拼图游戏   网页   JavaScript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!