<script>
$(document).ready(function () {
//var w = document.documentElement.clientWidth;
//var h = document.documentElement.clientHeight;
var w = window.screen.width;//取屏幕分辨率
var h = window.screen.height;
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
h = parseInt(h) - parseInt(150);
}
if (isiOS) {
h = parseInt(h) - parseInt(parseInt(h)*0.2);
}
w = parseInt(w) - parseInt(20);
//$("#div01").attr("style", "" + w + "px; height:" + h + "px; border:1px solid red;");
//$("#div01").attr("style", "" + w + "px; height:100%; border:1px solid red;");
$("#if01").attr("style", "" + w + "px; height:" + h + "px; margin:0.1rem; border:1px solid #000;");
//$("#if01").attr("width", w);
//$("#if01").attr("height", h);
});
</script>
<body>
<div id="div01" style="100%; height:100%; border:1px solid red;">
<iframe id="if01" src="https://p.qiao.baidu.com/cps/chat?siteId=6959701&userId=7009868" ></iframe>
</div>
</body>