调用打印预览问题

浏览器唤起打印后

window.print();
页面无法操作需要
window.location.reload();页面才可以操作
 
但是谷歌浏览器如果唤起打印后页面存在时间较长页面操作io都会失效需要增加
window.stop(); //立即停止重新加载
      return false; 
 
如:
print() {
      document.getElementsByClassName('frame-sub-nav')[0].style.display = 'none';
      document.getElementsByClassName('frame-header-box')[0].style.display = 'none';
      document.getElementsByClassName('tab-view')[0].style.display = 'none';
      document.getElementsByClassName('testDrivePreview-operate')[0].style.display = 'none';
      window.print();
      window.location.reload();
      window.stop(); //立即停止重新加载
      return false; 
    },
posted @ 2019-12-06 16:21  me春天  阅读(175)  评论(0编辑  收藏  举报