让iframe自动跟着屏幕调整大小
<script type="text/javascript">
var resizeTimer = null;
function doResize() {
var h = document.documentElement.clientHeight - 220;
if (h > 0)
$("#mainframe").css("height", h);
resizeTimer = null;
}
var t = document.documentElement.clientWidth;
var setHeight = function () {
if (t != document.documentElement.clientWidth) {
t = document.documentElement.clientWidth;
if (resizeTimer == null) {
resizeTimer = setTimeout("doResize()", 1000); //控制调用方法的时间间隔
}
}
}
window.onresize = setHeight;
doResize();
</script>
var resizeTimer = null;
function doResize() {
var h = document.documentElement.clientHeight - 220;
if (h > 0)
$("#mainframe").css("height", h);
resizeTimer = null;
}
var t = document.documentElement.clientWidth;
var setHeight = function () {
if (t != document.documentElement.clientWidth) {
t = document.documentElement.clientWidth;
if (resizeTimer == null) {
resizeTimer = setTimeout("doResize()", 1000); //控制调用方法的时间间隔
}
}
}
window.onresize = setHeight;
doResize();
</script>