自适应后显示不全,只能显示一半,求助!!
JS部分代码:
window.onload=function()
{
WINDOW_WIDTH=document.body.clientWidth;
WINDOW_HEIGHT=document.body.clientHeight;
MARGIN_LEFT=Math.round(WINDOW_WIDTH/10);
RADIUS=Math.round(WINDOW_WIDTH*4/5/108)-1;
MARGIN_TOP=Math.round(WINDOW_HEIGHT/5);
var canvas=document.getElementById("canvas");
var context=canvas.getContext("2d");
canvas.width=WINDOW_WIDTH;
canvas.height=WINDOW_HEIGHT;
curShowTimeSeconds=getCurrentShowTimeSeconds();
setInterval(
function(){
render(context);
update();
},50);
}
HTML部分代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body style="height:100%">
<canvas id="canvas" style="height:100%">
当前浏览器不支持canvas,请更换浏览器后再试
</canvas>
<script src="digit.js" type=text/javascript></script>
<script src="countdown.js" type=text/javascript></script>
</body>
</html>
后来我下载老师的直接打开老师的也是那样,不知道什么问题