- 注册时间
- 2011-7-8
- 最后登录
- 2011-7-8
- 阅读权限
- 10
- 积分
- 12
- 精华
- 0
- 帖子
- 1

|
- <script type="text/javascript">
- $.ajaxSetup ({
- cache: false
- });
- $(function(){
- $("#c-c-iframe").load(function(){
- $(this).height($(this).contents().height());
- //$(this).height($(this).contents().find("body").attr('scrollHeight'));
-
- var mainheight = $(this).contents().find("html").height();
- ///if(mainheight < 400){
- // mainheight = 400;
- //}
- $("#rightM").css("height",mainheight);
- $(".mainM").css("height",mainheight);
- alert(mainheight);
-
-
- });
-
- });
- </script>
复制代码 这是我的js代码
两个链接和iframe:
Java代码 
- <li><a href="selfinfo.jsp" target="c-c-iframe" title="个人信息" >个人信息</a></li>
- <li><a href="modifypass.jsp" target="c-c-iframe" title="修改密码" >修改密码</a></li>
-
- <iframe src="init.jsp" id="c-c-iframe" name="c-c-iframe" width="500px;" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>
<li><a href="selfinfo.jsp" target="c-c-iframe" title="个人信息" >个人信息</a></li> <li><a href="modifypass.jsp" target="c-c-iframe" title="修改密码" >修改密码</a></li> <iframe src="init.jsp" id="c-c-iframe" name="c-c-iframe" width="500px;" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>转自:http://www.javaeye.com/topic/281102
js代码:
Java代码 
- <script type="text/javascript">
- <!--
- $(function(){
- $("#c-c-iframe").load(function(){
- $(this).height($(this).contents().find("#content").height() + 40);
- });
-
- });
- -->
- </script>
我在网上在找的 这段代码
就是 实现 像framest的框架集的那种效果!
可是我每次 alert的值 火狐 是正常的 出来的值 是不同的
但 IE 就会出现 如果 第一次 是400 下次 还会计算还是 400 除非 iframe内部高度 大于400 就会出现大于400 但就是不会减小
我也不知道 我表达的清楚不清楚
望朋友们 多多 关照!
|
|