【发布时间】:2015-05-22 07:43:23
【问题描述】:
我正在尝试打印一个弹出窗口。我使用 Chrome,在其他浏览器中我不感兴趣。 这是我的弹出窗口:
这是我想打印时的预览:
问题很明显:如何只打印弹出窗口的内容?
PD:我放了角度标签,因为我使用它。调用模态窗口(popup)的方式是;
$scope.printPopup = function () {
$scope.opManSel = this.dataItem;
$modal.open({
templateUrl: '/OM_manager/printPopup',
backdrop: 'static',
controller: 'printPopupController',
scope: $scope
});
}
美好的一天!
更新: 在我的 CSS 中,我使用:
.noprint { display: none; }
#print{
visibility: visible;
display: block;
position:absolute;
margin-left: auto;
margin-right: auto;
width: 100%;
}
我的弹出窗口具有 id="print" 和其余元素具有类 'noprint',即使如此,背景显示。
【问题讨论】:
-
尝试使用 CSS3 @ media print 隐藏除弹出内容之外的所有内容。
标签: javascript angularjs html printing