JS根据屏幕分辨率改变背景宽高

  //控制浏览器显示的高宽
        function document_loaded() {
            GotoMainStep(0);
            var WH = document.body.scrollHeight*3/4;
            document.getElementById("main1").style.height = WH + "px";
            var WW = document.body.scrollWidth * 3 / 4;
            document.getElementById("main2").style.height = WW + "px";
            //js预加载
            //setTimeout(function () {
            //    if(window.parent && window.parent.YZLoader && window.parent.YZLoader.cache)
            //        window.parent.YZLoader.cache();
            //}, 50);
        }
原文地址:https://www.cnblogs.com/jiuban2391/p/6796233.html