How to get height and width after window resize

后端 未结 3 2048
南方客
南方客 2021-01-14 13:10

I have a scorm module which launches in a new window with resizable = 1 in window.open in my js file:

function OpenScormModuleWindow(scormModuleId, scormModu         


        
3条回答
  •  庸人自扰
    2021-01-14 13:24

    This is the best way as far as I can see;

    function resizeCanvas() {
        canvas.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
        canvas.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
    
        WIDTH = canvas.width;
        HEIGHT = canvas.height;
    }
    

提交回复
热议问题