MozTW 討論區 https://forum.moztw.org/ |
|
使用iframe動態調整高度遇到的問題 https://forum.moztw.org/viewtopic.php?f=13&t=28255 |
第 1 頁 (共 1 頁) |
發表人: | rotin1122 [ 2009-10-09, 15:03 ] |
文章主題 : | 使用iframe動態調整高度遇到的問題 |
我用iframe設計網頁 其中有使用某個自動讀取網頁高度的JS http://140.117.157.18/tech/nsysuee2/en8.asp 出現的問題:IE8下還算OK 不過FF下就有問題 點一下contact us明顯看出高度掛點 ![]() 有辦法改嗎@@ 幫我看看 我把主要引用的PO一下其他程式碼麻煩去看網頁原始碼^^"(這是引用網頁來源http://www.zeali.net/entry/81) 如果有相關參考文章 也請告知 謝謝 ![]() <script language="Javascript"> var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] //extra height in px to add to iframe in FireFox 1.0+ browsers var FFextraHeight=getFFVersion>=0.1? 16 : 0 function dyniframesize(iframename) { var pTar = null; if (document.getElementById){ pTar = document.getElementById(iframename); } else{ eval('pTar = ' + iframename + ';'); } if (pTar && !window.opera){ //begin resizing iframe pTar.style.display="block" if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){ //ns6 syntax pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight; } else if (pTar.Document && pTar.Document.body.scrollHeight){ //ie5+ syntax pTar.height = pTar.Document.body.scrollHeight; } } } </script> |
第 1 頁 (共 1 頁) | 所有顯示的時間為 UTC + 8 小時 |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |