Javascript 基于画布的Html5 div交叉浏览器
我试着在整版画布上加上一个div。在Chrome上效果很好,但在firefox和ie9上它会变成“kaput” 这里有一个链接,指向该代码(在firefox chrome和ie9中试用过),只有chrome看起来有效Javascript 基于画布的Html5 div交叉浏览器,javascript,html,canvas,Javascript,Html,Canvas,我试着在整版画布上加上一个div。在Chrome上效果很好,但在firefox和ie9上它会变成“kaput” 这里有一个链接,指向该代码(在firefox chrome和ie9中试用过),只有chrome看起来有效 IE9文档中的没有属性document.width/document.height,因此您将画布宽度/高度设置为0 试用 canvas.width = document.body.clientWidth; canvas.height = document.body.clientHe
IE9文档中的没有属性
document.width/document.height
,因此您将画布宽度/高度设置为0
试用
canvas.width = document.body.clientWidth;
canvas.height = document.body.clientHeight;
或
好的,非常感谢。我修好了。很高兴了解文档属性。再次感谢
canvas.width = $(document).width();
canvas.height = $(document).height();