【问题标题】:How to print all frames on the page in one file如何在一个文件中打印页面上的所有框架
【发布时间】:2015-09-18 05:37:18
【问题描述】:

我正在使用frameset 标签,我想打印框架集中的所有框架

<html>
     <frameset rows="10%,*">
       <frame name="top_frame" src="top-frame.htm" frameborder="1" noresize="0" scrolling="no">
       <frameset cols="20%,*">
          <frame name="left_frame" src="left-frame.htm" frameborder="0" noresize="0" scrolling="no">
          <frame name="right_frame" src="right-frame.htm" frameborder="0" noresize="0" scrolling="auto">
       </frameset>
    </frameset>
</html>

我使用了parent.window.focus();parent.print();,它在 Chrome 中工作,但在 IE11 中,它在一个文件中打印每一帧。

有什么建议吗?

我也使用了parent.window.focus();window.print();,但两者都不起作用。

【问题讨论】:

  • 我用过,还是不行

标签: javascript printing frame


【解决方案1】:

这应该可行:

try{
    document.execCommand('print', false, null);
}
catch(e){
    window.print();
}

Source link

【讨论】:

  • 仍然只打印顶部框架而不是可见窗口
猜你喜欢
  • 2012-01-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-07
  • 2011-04-15
  • 2012-04-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多