default.aspx页面里
<script>
function dyniframesize(iframename)
{
var pTar = null;
if (document.getElementById)
{
pTar = document.getElementById(iframename);
}
else{
eval('pTar = ' + iframename + ';');
}
if (pTar && !window.opera){
//begin resizing iframe
pTar.style.display="block"
if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
//ns6 syntax
pTar.height = pTar.contentDocument.body.offsetHeight+10;
}
else if (pTar.Document && pTar.Document.body.scrollHeight){
//ie5+ syntax
pTar.width = pTar.Document.body.scrollWidth;
pTar.height = pTar.Document.body.scrollHeight;
}
}
}
</script><body onload="dyniframesize('iframe1')">打开default.aspx的时候,iframe自适应大小了。
现在是:
iframe里的有个查询按钮,查询后我也需要让它适应大小,否则有时候数据被遮住了。
查询按钮里应怎么写一下代码?
<script>
function dyniframesize(iframename)
{
var pTar = null;
if (document.getElementById)
{
pTar = document.getElementById(iframename);
}
else{
eval('pTar = ' + iframename + ';');
}
if (pTar && !window.opera){
//begin resizing iframe
pTar.style.display="block"
if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
//ns6 syntax
pTar.height = pTar.contentDocument.body.offsetHeight+10;
}
else if (pTar.Document && pTar.Document.body.scrollHeight){
//ie5+ syntax
pTar.width = pTar.Document.body.scrollWidth;
pTar.height = pTar.Document.body.scrollHeight;
}
}
}
</script><body onload="dyniframesize('iframe1')">打开default.aspx的时候,iframe自适应大小了。
现在是:
iframe里的有个查询按钮,查询后我也需要让它适应大小,否则有时候数据被遮住了。
查询按钮里应怎么写一下代码?
解决方案 »
- 『求助』如何用JS将时间戳转换为时间?
- javascript弹出层,求高人指教
- |zyciis| 有没有一个JQuery的学习网像http://www.aa25.cn/这个学习CSS网一样,提供很多的救命教程的呢,谢谢
- 为什么window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)无效?
- 层能不能盖过frame?
- 如何用js接收变量值
- 这是IE的漏洞吗?
- 帮我看看我的代码 :)
- 帮忙看看这段代码?
- 新人第一帖,求指导实现类似标签页的效果
- div.innerHTML等于值的时候,可能会遇到象 ,.;';o[[这样的字符,会报错,如何解决?
- js客户端使用xmlhttp跨域访问xml的问题。
在viewdata.aspx的刷新事件中修改document.parent的尺寸
如果变化不多最好别用,这个东西占资源