瀏覽器兼容 ie8+, chrome, firefox ...css
源碼地址:https://github.com/capricornc...html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Tetris - 俄羅斯方塊單機版 - Capricorncd</title> <link rel="stylesheet" href="../dist/css/tetris.css" type="text/css"> <style> body {background-color: #333;} .game-box { float: left; margin-right: 10px; padding: 10px; width: 320px; height: 540px; border: 1px solid #999} </style> </head> <body> <div class="game-box" id="TetrisA"></div> <script src="../dist/js/tetris.js"></script> <script> new Tetris({ // 可選參數,默認爲body container: '#TetrisA', // 錯誤回調 error: function (err) { console.error(err) }, // 遊戲DOM結構建立完成回調 ready: function (res) { console.log(res) } }) </script> </body> </html>
以爲‘好玩’,記得點【★Star】,走過路過千萬不要錯過Orzgit
源碼地址:https://github.com/capricornc...github