我为情人节制作了这个简单的游戏,但由于某种原因,我的画布无法在firefox上显示出来。它可以在safari和chrome中运行,没有任何问题。我是web dev的新手,所以在这里我完全没有想法。
http://schwiz.net/valentine/?lover=StackOverflow%20User
发布于 2013-02-15 03:18:33
尝试使用以下命令:
function updateCanvasDimensions() {
canvas.width = document.body.clientWidth;
canvas.height = document.body.clientHeight;而不是document.width和document.height。我似乎在Firefox和Chrome上都能用,但我还没有在其他浏览器上尝试过。
edit请参阅:https://developer.mozilla.org/en-US/docs/DOM/document.width
https://stackoverflow.com/questions/14881781
复制相似问题