这个例子里iframe一直和窗口一样大.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<script type="text/javascript">
function resizeFrame()
{
document.all("f1").width = document.body.clientWidth;
document.all("f1").height = document.body.clientHeight;
}
window.onresize = resizeFrame;
window.onload = resizeFrame;
</script>
</head>
<body style="margin:0 0 0 0;">
<iframe src="" id="f1" style="margin:0 0 0 0;"></iframe>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<script type="text/javascript">
function resizeFrame()
{
document.all("f1").width = document.body.clientWidth;
document.all("f1").height = document.body.clientHeight;
}
window.onresize = resizeFrame;
window.onload = resizeFrame;
</script>
</head>
<body style="margin:0 0 0 0;">
<iframe src="" id="f1" style="margin:0 0 0 0;"></iframe>
</body>
</html>
解决方案 »
- 今天和公司签约了,发个帖子庆祝下
- 用js改变字体大小。。。document.getElementById("mytd").style.FontSize=xx;为何没效果
- 帮忙看看这段代码怎么改啊?
- 很簡單的問題,大家幫幫忙!
- 如何用JavaScript实现在工具栏Toolbar中点击不同的按钮,对应的鼠标图片也变成自己定义的图片?我写了如下代码,怎么不能实现啊?谢谢,
- 鼠标事件与键盘输入?????
- 送高分来求教一问题:如何使表格中插入新行定义onclick事件?
- 怎样判定一个函数是否存在?
- 怎样去检测文件是否存在???????
- 如何打开选择文件的对话框?并返回选择文件的路径.
- 集中导入脚本的方法?
- 求 radio + text 的显示与隐藏的问题
iframe.height = document.body.offsetHeight;