function setGameCanvasSize(gameCanvasId) { var scale = document.documentElement.clientHeight/gameCanvasId.offsetHeight; gameCanvasId.style.marginLeft = -(gameCanvas.clientWidth)/2 + ‘px‘; gameCanvasId.style.MozTransform = ‘scale(‘ + scale + ‘)‘; gameCanvasId.style.MsTransform = ‘scale(‘ + scale + ‘)‘; gameCanvasId.style.OTransform = ‘scale(‘ + scale + ‘)‘; gameCanvasId.style.WebkitTransform = ‘scale(‘ + scale + ‘)‘; gameCanvasId.style.transform = ‘scale(‘ + scale + ‘)‘; }
时间: 2024-10-15 08:51:46