最近做的一个简陋的手机端拼图游戏,代码简单易懂,废话不多说了,让大家证明一切吧!
先看下效果图:
document html,body,ul,li,ol,dl,dd,dt,p,h1,h2,h3,h4,h5,h6,form,fieldset,legend,img{margin:0;padding:0} body{ background: pink; } #picbox{ width: 300px; height: 300px; background: url('img/300.jpg'); position: relative; margin: 50px auto; } .pic{ width: 97px; height: 97px; float: left; background: url('img/300.jpg'); position: absolute; transition: all 0.5s ease 0s; } .controller{ text-align: center; position: relative; } #times{ position: absolute; color: red; top: 15px; left: 300px; font-size: 20px; } 拼图游戏
代码还有很多可以优化的地方,比如增加定时功能,游戏成功效果和声音特效,手指滑动的自定义事件,左划右划,上划下划,进一步的封装等,额,这样一想又忍不住想试试敲敲代码了。。后续小编在给大家持续更新吧,今天先到这里,希望大家能够喜欢!



