Re: [問題] iframe...

看板Web_Design作者 (德)時間13年前 (2013/01/20 17:36), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《GuCD (德)》之銘言: : 想請問我在網頁裡 : 嵌入了一個iframe : 連結到一個.php(類似留言板) : 而該網址有兩層頁面 : 第一層是各個標題(長度大概是固定的) : 點擊進入第二層的話 : 因為留言長短關係 : 長度會變化 : 但是因為頁面排版關係 : 不想讓iframe出現捲軸 : 希望每一頁可以彈性加長或縮短 : 試過幾個網上找的javascript都還是不成功 : 只能抓到第1層的高度 : 點擊進入第2層後 : 高度就無法變化了 : 不知道有無解決的辦法? : 謝謝 <script type="text/javascript"> function reinitIframe() { var iframeid=document.getElementById("main"); //iframe id if (document.getElementById) { if (iframeid && !window.opera) { if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight) { iframeid.height = iframeid.contentDocument.body.offsetHeight; }else if(iframeid.Document && iframeid.Document.body.scrollHeight) { iframeid.height = iframeid.Document.body.scrollHeight; } } } } </script> <iframe id="main" onload="Javascript:reinitIframe();" class="text" scrolling="no" frameborder="0" src="http://db.gpdeva.com/gp_web/............................." height="300px"></iframe> 附上原始檔,google了好像說不適用於外部連結。那外部連結應如何解決? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.116.173.209

01/20 20:10, , 1F
http://ppt.cc/U8iO 第一種試試
01/20 20:10, 1F

01/20 20:12, , 2F
不過問題應該是onload要改掉才是
01/20 20:12, 2F

01/22 16:21, , 3F
謝謝,我研究看看。感謝
01/22 16:21, 3F
文章代碼(AID): #1G-xgncF (Web_Design)
討論串 (同標題文章)
本文引述了以下文章的的內容:
問題
0
2
完整討論串 (本文為第 2 之 2 篇):
問題
0
2
文章代碼(AID): #1G-xgncF (Web_Design)