<script type="text/javascript">?function reinitIframe(v_val) { var iframe = document.getElementById(v_val); try { var bHeight = iframe.contentWindow.document.body.scrollHeight; var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; var height = Math.min(bHeight, dHeight); iframe.height = height; }? catch (ex){}}window.setInterval("reinitIframe('autoframe')", 200);?</script>我有三個(gè)問題:1.為什么要用try {...}catch (ex){} ?這個(gè)有什么作用呢?2.為什么window.setInterval("reinitIframe('autoframe')", 200); 改成reinitIframe('autoframe') 就沒效果?3.如何兼容360和火狐瀏覽器?請(qǐng)各位老師指導(dǎo),謝謝~
iframe自適應(yīng)高度 如何兼容360和火狐瀏覽器
Sunshine518
2014-09-22 17:03:52