移动端设置定时器设置高度弹出框高度

var clock = setInterval('timer()',1000);

function timer(){

if(window.innerHeight <= window.clientHeight){

document.getElementsByClassName('layui-m-layerchild')[0].style.height = (window.innerHeight) + 'px';

}else{

document.getElementsByClassName('layui-m-layerchild')[0].style.height = (window.clientHeight) + 'px';

clearInterval(clock);

}

}

你可能感兴趣的:(移动端设置定时器设置高度弹出框高度)