<iframe id="ididid" src="https://hao.360.cn">
</iframe>
<script type="text/javascript">
function autoHeight(){
if (window.innerHeight){//FF
nowHeight = window.innerHeight;
}else{
nowHeight = document.documentElement.clientHeight;
}
var jianHeight = 0; //随padding值改变
if(nowHeight > jianHeight){
document.getElementById('ididid').style.height = nowHeight - jianHeight + 'px';
}else{
document.getElementById('ididid').style.height = jianHeight + 'px';
}
}
autoHeight();
window.onresize = autoHeight;
</script>