浏览器适配屏幕分辨率问题

<script>
         var width=document.documentElement.clientWidth;
         var height=document.documentElement.clientHeight;
         console.log(width)
         console.log(height)
         var sacle=width/1920>height/1080?height/1080:width/1920;
         document.getElementsByTagName('body')[0].style.zoom=sacle;
</script>

猜你喜欢

转载自www.cnblogs.com/liujiajiablog/p/10536134.html
今日推荐