惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
V
V2EX
博客园 - 【当耐特】
Vercel News
Vercel News
雷峰网
雷峰网
爱范儿
爱范儿
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Azure Blog
Microsoft Azure Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
NISL@THU
NISL@THU
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
P
Proofpoint News Feed
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
I
InfoQ
Google Online Security Blog
Google Online Security Blog
L
LINUX DO - 最新话题
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
V
Visual Studio Blog
AI
AI
Schneier on Security
Schneier on Security
B
Blog RSS Feed
T
Tor Project blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Cyber Attacks, Cyber Crime and Cyber Security
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
Webroot Blog
Webroot Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

博客园 - 江湖工夫

TextBox控件TextMode=Password时赋值 [转]随滚动条滚动的层(支持IE6,FF2) 抓取网络文件的URL地址作附件发送 SQL注入的漏洞,过滤httprequest Visual SourceSafe应用守则[转] Microsoft SQL Server 分析服务 SQL中使用DISTINCT显示多个字段的方法(不使用DISTINCT了) GridView分页后跳转其他页面进行添加,编辑,删除操作后,仍返回到当前页码[原] Ajax的按钮事件效果 层的移动,使用了jquery asp.net(C#)处理数据一个通用类,包括存储过程,适用于初学者[转] IE和Firefox在JavaScript方面的兼容性(汇编) asp.net 对xml文件的读写,添加,修改,删除操作[转] 一些动画进度的图标链接 邹建的通用分页存储过程[转] 一个存储过程实现将Excel数据导入数据库 SQL SERVER事务处理[转] SQL与MDX语法的比较 一个存储过程
Iframe页面内容变更页面自动改变大小(非加载时自适应大小)
江湖工夫 · 2008-07-17 · via 博客园 - 江湖工夫

直接上代码.
父页面Praent.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Parent</title>
<script language="javascript">
    
function resizeIframe(obj,objId)
       
var docHeight = document.frames[objId].document.body.scrollHeight ;
       
var docWidth =  document.frames[objId].document.body.scrollWidth;
    
       obj.style.height 
= docHeight  + 'px';
        obj.style.width 
= docWidth   + 'px';
    }
 
</script>
</head>

<body style="margin: 0;">
<table border="0" cellpadding="0" cellspacing="0" class="Table-BG-Line" height="100%">
  
<tr valign="top">
    
<td width="650px"><iframe name="Content" id="Content" scrolling="no" frameborder="0" width="650"
onload
="this.height=Content.document.body.scrollHeight;this.width=Content.document.body.scrollWidth;"
 src="Child.htm"></iframe></td>
  
</tr>
</table>
</body>
</html>

子页面Child.htm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Child</title>
<script language="javascript">
function LoadPickingAdd()
{
    
var objMethod = document.getElementById("ddlMethod");
    
var objAddress = document.getElementById("trAddress");
    
if (objMethod == null)
    
{
        objAddress.style.display 
= "inline";
    }

    
else
    
{
        
if (objMethod.selectedIndex == 0)
        
{
            objAddress.style.display 
= "none";
        }

        
else
        
{
            objAddress.style.display 
= "inline";
        }
        
    }

}

function GetAddr()
{
    
var objMethod = document.getElementById("ddlMethod");
    
var objAddress = document.getElementById("trAddress");
    
if (objMethod.selectedIndex == 0)
    
{
        objAddress.style.display 
= "none";
    }

    
else
    
{
        objAddress.style.display 
= "inline";
        
//以下代码实现自动调整子页面高度.
        if(top.location != self.location)  
        
{  
          
var a = window.parent.document.getElementsByName(self.name);  
          a[
0].height = document.body.scrollHeight;  
        }

    }

}

</script>
</head>

<body onload="LoadPickingAdd()" style=" margin:0">
<form id="form1" method="post" action="">
<p>
  
<select name="ddlMethod" id="ddlMethod" onchange="GetAddr()">
    
<option value="0">0</option>
    
<option value="1">1</option>
  
</select>
</p>
<p>&nbsp; </p>
<table width="200" border="1" height="100%">
  
<tr id="trAddress" style="display:inline">
    
<td>a</td>
    
<td>&nbsp;</td>
  
</tr>
  
<tr>
    
<td>b</td>
    
<td>&nbsp;</td>
  
</tr>
  
<tr>
    
<td>c</td>
    
<td>&nbsp;</td>
  
</tr>

  
<tr>
    
<td>d</td>
    
<td>&nbsp;</td>
  
</tr>
  
<tr>
    
<td>e</td>
    
<td>&nbsp;</td>
  
</tr>
  
<tr>
    
<td>f</td>
    
<td>&nbsp;</td>
  
</tr>
</table>
</form>
</body>
</html>

posted @ 2008-07-17 11:50  江湖工夫  阅读(4301)  评论(1)    收藏  举报

刷新页面返回顶部