本文实例讲述了Javascript扫雷游戏。分享给大家供大家参考,具体如下:
翻出年初写的游戏贴上来,扫雷相信大家都玩过,先上图:
源码:
Javascript版扫雷 input{ margin:0; padding:0;} input{ outline:none;} #game_box{ width:400px; height:430px; margin:100px auto; border:#333 1px solid; background:#ccc -webkit-repeating-linear-gradient(top,#ccc,#000);background:#ccc -moz-repeating-linear-gradient(top,#ccc,#000);background:#ccc -o-repeating-linear-gradient(top,#ccc,#000);background:#ccc -ms-repeating-linear-gradient(top,#ccc,#000); box-shadow:0 0 50px 10px #333; box-shadow:0 0 50px 10px #333; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#CBCBCB', endColorstr='#000000'); } #map{width:400px; height:348px;*height:380px;} #time{ height:18px; line-height:22px; text-align:center;margin:6px 0; margin-top:10px; _margin-top:40px; color:#fff; position:relative;} #time input{ width:40px; height:18px; line-height:18px; text-align:center;} #table_map{ width:336px; height:336px; border:none; border-left:#000 1px solid;border-top:#000 1px solid; margin:32px 32px 0px 32px; background:#D8ECF6; text-align:center; border-collapse: collapse} #table_map td{ width:20px; height:20px; border:none;border-right:#000 1px solid;border-bottom:#000 1px solid; color:#333333; transition:all 0.7s; cursor:pointer;} #table_map td.mask{ border:none;border-right:#000 1px solid;border-bottom:#000 1px solid; background:#333; } #table_map td.over{ border:none;border-right:#000 1px solid;border-bottom:#000 1px solid; } .over_bg{ background:#E1E1E1;} @-webkit-keyframes round{ from{ -webkit-transform:rotateX(0);} to{ -webkit-transform:rotateX(360deg);} } @-webkit-keyframes show{ from{ -webkit-transform:rotateX(180deg) rotateY(0) scale(0);} to{ -webkit-transform:rotateX(360deg) rotateY(360deg) scale(1);} } @-moz-keyframes round{ from{ -moz-transform:rotateX(0);} to{ -moz-transform:rotateX(360deg);} } @-moz-keyframes show{ from{ -moz-transform:rotateX(180deg) rotateY(0) scale(0);} to{ -moz-transform:rotateX(360deg) rotateY(360deg) scale(1);} } @-ms-keyframes round{ from{ -ms-transform:rotateX(0);} to{ -ms-transform:rotateX(360deg);} } @-ms-keyframes show{ from{ -ms-transform:rotateX(180deg) rotateY(0) scale(0);} to{ -ms-transform:rotateX(360deg) rotateY(360deg) scale(1);} } #game_box{-webkit-animation:show 3s;-moz-animation:show 3s;-ms-animation:show 3s;} 时间: 炸弹:
完整实例代码点击此处本站下载。
更多关于Javascript相关内容感兴趣的读者可查看本站专题:《Javascript数据结构与算法技巧总结》、《Javascript数学运算用法总结》、《Javascript切换特效与技巧总结》、《Javascript查找算法技巧总结》、《Javascript动画特效与技巧汇总》、《Javascript错误与调试技巧总结》及《Javascript遍历算法与技巧总结》
希望本文所述对大家Javascript程序设计有所帮助。



