隨筆-46  評論-54  文章-0  trackbacks-0
          Searching "iframe height 100" in 谷歌!
          1、
          <iframe?height="100%">?
          no work

          2、
          <iframe?stlye="height:?100%;">?
          no work

          3、CSS
          1?/***?html?file?***/
          2?
          3?<p?class="forum2">
          4??<iframe?src="http://mydomain.com/phpbb"?title="Forum"?scrolling="auto">
          5??</iframe>
          6?</p>

          ?1?/***?css?file?***/
          ?2?
          ?3?..forum2?{
          ?4?????height:?900px;
          ?5?????width:?100%;
          ?6?}
          ?7?
          ?8?IFRAME?{
          ?9?????min-height:?900px;
          10?????height:?100%;
          11?????width:?100%;
          12?}


          4、JavaScript
          ?1?<script?language="JavaScript">
          ?2?<!--
          ?3?function?resize_iframe()
          ?4?{
          ?5???//resize?the?iframe?according?to?the?size?of?the
          ?6?
          ?7???//window?(all?these?should?be?on?the?same?line)
          ?8?
          ?9???document.getElementById("glu").height=
          10?????document.body.offsetHeight-
          11?????document.getElementById("glu").offsetTop-26;
          12?}
          13?
          14?//?this?will?resize?the?iframe?every
          15?//?time?you?change?the?size?of?the?window.
          16?window.onresize=resize_iframe;?
          17?
          18?//Instead?of?using?this?you?can?use:?
          19?//????<BODY?onresize="resize_iframe()">
          20?
          21?
          22?//-->
          23?</script>

          1?<iframe?id='glu'?width=100%?onload='resize_iframe()'>
          2?</iframe>


          5、用CSS構(gòu)建iframe效果的四種方法

          6、W3C關(guān)于iframe的描述
          posted on 2006-04-18 19:28 rox 閱讀(4966) 評論(5)  編輯  收藏 所屬分類: AJAX

          評論:
          # re: How to set iframe height 100% or scrollable at out page? 2006-04-20 22:26 | rox
          一個很牛的JavaScript網(wǎng)站!
          http://www.activewidgets.com/


          Google 中搜索 "iframe auto height"

          1、Auto Fit IFrame to Content
          http://www.devpapers.com/article/200

          2、iFrame Auto Resize
          About a month ago I was faced with the same need (to conditionally resize an iframe) and discovered that it just wouldn't work reliably due to browser quirks.
          However, I solved the problem by creating a div in the parent page that got replaced with the innerHTML from the body of the document in the iframe. Worked like a charm.
          You can use an onload event in the iframe element in the parent page or an onload event in the body of the document in the iframed page to trigger the exchange.

          Post a stripped down version of the page if you can. One that shows exactly how the iframe fits into the structure of the page.

          The solution I settled on works like this:
          The parent page has a javascript function like this:

          function insertIt() {
          var _y = document.getElementById('framediv');
          var _x = window.frames[0].document.body.innerHTML;
          _y.innerHTML = _x
          }
          Then, the parent page has a div with the id "framediv" which is placed where the contents of the iframe should appear on the page.
          The iframe element is then placed inside the div, like this:

          <div id="framediv">
          <iframe onload="insertIt();" src="/somewhere/content.htm" frameborder="no" width="555px" scrolling="no">
          </div>

          As you can see, there's onload="insertIt()" inside the iframe element. So when the iframe loads, the parent page immediately takes the contents of the body of the document contained in the iframe and actually replaces the iframe element with that content.

          It's a little tricky to comprehend, but it works great.

          You said you're a newbie, does this make any sense to you?

          also, is the iframe document located on the same server and the same domain as the parent page?
          That will play a part.   回復(fù)  更多評論
            
          # re: How to set iframe height 100% or scrollable at out page? 2006-06-29 14:56 | rox
          Dynamic iframe height

          Iframe SSI script II
          http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm  回復(fù)  更多評論
            
          # re: How to set iframe height 100% or scrollable at out page? 2006-07-14 17:19 | rox
          <?xml version="1.0" encoding="gb2312"?>
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
          <head>
          <meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
          <meta http-equiv="Content-Language" content="zh-CN" />
          <title>垂直居中</title>
          <style type="text/css">
          body, html { height:100%; }
          #outer { height:100%; overflow:visible; position:relative; }
          #outer[id] { display:table; position:static; }
          #middle { position:absolute; top:50%; }
          #middle[id] { display:table-cell; vertical-align:middle; position:static; }
          #inner { position:relative; top:-50%; }
          #inner[id] { position:static; }
          </style>
          </head>
          <body>
          <div id="outer">
          <div id="middle">
          <div id="inner">
          <p>111111這個在IE中可以實現(xiàn)居中,在Firefox中也可以實現(xiàn)居中1111111</p>
          </div>
          </div>
          </div>
          </body>
          </html>  回復(fù)  更多評論
            
          # re: How to set iframe height 100% or scrollable at out page? 2010-03-29 13:40 | rox
          # re: How to set iframe height 100% or scrollable at out page? 2014-03-14 11:01 | rox
          IE and chrome
          var iframe= $("#targetFrame");
          onloadEvent = 'this.style.height=Math.max(this.contentWindow.document.body.scrollHeight,this.contentWindow.document.documentElement.scrollHeight,200)+"px";'
          +'this.style.width="100%";';
          iframe.parent().css("height", "100%"); //div , p
          iframe.parent().css("width", "100%");
          iframe.attr("src", url);
          iframe.attr("onload", onloadEvent);   回復(fù)  更多評論
            
          <2010年3月>
          28123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          常用鏈接

          留言簿(3)

          隨筆分類(30)

          隨筆檔案(47)

          一些達人!

          • 分享——知識與快樂 pragmatic programmer: programming for fun and money 不管是什么風,歡迎您的到來! 自我介紹 我現(xiàn)在上海某公司擔任軟件設(shè)計師,愛好軟件設(shè)計,架構(gòu)和設(shè)計模式等。涉及EAI, ERP, SCM, DCM等。 歡迎批評建議,共尋合作機會,共創(chuàng)美好未來!
          • cnJava 的BLOG
          • 又一個Java牛人!
          • Java Security高手,常常會出些題目。
          • Java Security 視野,平臺,戰(zhàn)略
          • JBoss Rules(Drools) 學(xué)習(xí)筆記
          • 記錄學(xué)習(xí)JBoss Rules的點點滴滴
          • jini(99% jakarta)的 Blog
          • jini(99% jakarta)雅加達爪哇咖啡臺灣總店
          • SenTom,源自“盛唐”!
          • SenTom,源自“盛唐”,致力于Java開源項目在中國的推廣,以及文檔中文化! SenTom,非營利站點,只希望能為 Java Open Source 社區(qū)貢獻一點力量! 如果你愿意支持我們: 可以在你的網(wǎng)站為SenTom做一個連接; 可以向我們推薦你知道的Java開源項目; 可以向我們推薦你閱讀過的Java開源項目技術(shù)文章; 可以向我們提供你撰寫的Java開源項目技術(shù)文章; 聯(lián)系email:wayne@sentom.net
          • xheaven的專欄
          • 又一個DB4O的達人!
          • 一個Ruby達人
          • http://ruby-cn.org/的站長,翻譯了不少文檔了。 牛人一個。
          • 東波'S BLOG
          • 生活,學(xué)習(xí),工作的一點看法,想法
          • 利我博客
          • 利我博客,達人,絕對的達人。
          • 孤獨鍵盤手
          • BlogJava-xmatthew
          • 干煸四季豆
          • 給我一支煙,吞云吐霧間,讓所有煩累疲勞能夠過往如云煙~~~ 我的能力是協(xié)助團隊取得成功并盡快掌握新知識。
          • 成都心情
          • 成都心情 技術(shù)本身沒有優(yōu)良,只有不良的設(shè)計和應(yīng)用。 本 Blog 是從:http://blog.csdn.net/rosen 搬來。
          • 陳剛的BLOG
          • 子在川上曰 逝者如斯夫不舍晝夜

          優(yōu)秀個人

          優(yōu)秀資源

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 达孜县| 岢岚县| 青浦区| 津市市| 盐城市| 镇沅| 章丘市| 辽源市| 平潭县| 安塞县| 邯郸市| 固阳县| 大石桥市| 高密市| 武汉市| 台山市| 华容县| 兴化市| 多伦县| 皮山县| 张家港市| 天长市| 大宁县| 桦甸市| 乾安县| 塘沽区| 浪卡子县| 博罗县| 大同县| 石屏县| 三明市| 宁强县| 图们市| 合川市| 武城县| 阿拉尔市| 吉木萨尔县| 图木舒克市| 榆社县| 扬中市| 永康市|