export function getWindows(id){
let baseid=document.getElementById(id)
console.log(baseid)
const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width
const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height
console.log(width)
console.log(height)
console.log(baseid.style)
baseid.style.width = width+'px';
baseid.style.height =height+'px';
}
//用法
// getWindows("baseId");
// window.onresize=function(){
// getWindows("baseId")
// }
网友评论