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

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - max chan

企业管理软件开发XP 被逼上 Visual Studio 2008 被逼上 visual studio 2005 超级gnFindWindow FLL - C++与VFP 双向混合编程 C++ 松花江上 函数glDefinePopup(),动态定义多级的popup菜单 复习 树-递归 全面自定义 - 代码挂接 设计原则 聪明与代价 VFP程序,全面自定义之表单/类 VFP通用代码(vcx/scx/prg)混淆器,可以下载了 备份策略 死里逃生 先舍后得 VFP -> dot net 过渡 -- foxpro toolkit for dot net VFP与DOT NET之间的过渡 - SEDNA
iframe 高度自动调节,最简单解决
max chan · 2007-12-24 · via 博客园 - max chan

为了公司网站的改版,也为了学ASP.NET,这几天花了N多时间在 vs2005/vs2008/asp.net 上面。

目标:母版页+菜单+iFrame的完美解决 
http://www.yxsoft.net

(还是旧内容,未上传)
--------------------
| 母版 title        |
--------------------
|          |              
|index |  iframe 
|menu |  内容页
|          |              
-------------------
| 母版 footer    |
-------------------

点击左面菜单/tree,通过设置tree的navi-url,在右面的iframe动态加载内容页面。
iframe 要按内容页面 自动适应 自动调节高度 。

母版,菜单 比较好解决。

iFrame高度自动调节,好象是个难题耶。
GOOGLE一下,方法一大堆,有点太复杂,都不大行。
vs2008的帮助又动不了,连看个iframe类模型都无办法,菜啊。

试了N回,下面简单代码可以了,asp.net 2.0条件下。

<iframe id="content" name="content" scrolling="no" frameborder="0" width="754px" height="50px"     onload = "height = this.

Document.body.scrollHeight + 30;" >   </iframe>

注意事项
1、height设为auto不行的,一定要有一个值
2、this.document引用到是的 iframe所在页面对象,
      this.Document (

大写D),才能引用到iframe内含对象

这个方法可能更稳妥
 onload = "height =

document.frames(this.name).document.body.scrollHeight + 30"

3、Opera, firefox,这两LAJI就不考虑啦,日后再说