js代码
<script src="game.js"></script> <script> window.onload = function () { var height = document.documentElement.clientHeight; var kbBox = document.getElementById("kbBox"); var top = height - 400; console.log(top); kbBox.setAttribute("style","height:"+top/2+"px"); var startGameId = document.getElementById("startGame"); var enterGameId = document.getElementById("enterGame"); var gameId = document.getElementById("gameId"); enterGameId.onclick = function () { gameId.setAttribute("style","display:block"); startGameId.setAttribute("style","display:none"); Loop(); } } </script>