1、 

<a href="port" target="frame_view">港口资料</a>

<iframe ></iframe>

使用target可以多个页面调用

2、使之自适应屏幕大小

 

//iframe自适应高度
function setIframeHeight(iframe) {
if(iframe) {
var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if(iframeWin.document.body) {
iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
}
}
};

window.onload = function() {
setIframeHeight(document.getElementById('external-frame'));
};

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2022-02-07
  • 2021-07-11
  • 2022-12-23
  • 2021-08-28
  • 2021-08-15
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2021-12-07
  • 2022-12-23
  • 2021-06-28
  • 2021-08-11
相关资源
相似解决方案