1
我有我的網站的靜態,測試版本在這裏舉行:如何將畫布展開到Firefox中的整個視口?
http://alexgolec.staticloud.com/
,但是當我在Firefox中火起來,在畫布上不能正常調整。我認爲問題的代碼行是在這裏:
var _docHeight = (document.height !== undefined) ? document.height :
document.body.offsetHeight;
var _docWidth = (document.width !== undefined) ? document.width :
document.body.offsetWidth;
ctx.canvas.width = _docWidth;
ctx.canvas.height = _docHeight;
此代碼工作正常在WebKit的瀏覽器,但壁虎似乎BARF就可以了。