我有销售报告,我想打印一个标志,但我不希望它显示在屏幕上。
我目前正在尝试使用JavaScript从页面中打印特定的DIV:
<script type="text/javascript">
function PrintDiv() {
var divToPrint = document.getElementById('divToPrint');
var popupWin = window.open('', '_blank', 'width=300,height=300');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' +
divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<a href="#" onclick="PrintDiv();">Print page</a>这是正确的方法,我应该使用,以便徽标只显示在印刷销售报告?
发布于 2013-09-17 08:11:28
使用打印样式表显示徽标。
将徽标保留在报表的屏幕版本中,用普通样式表隐藏该div即可。
在打印样式表中,只需显示带有徽标的div。
下面是使用打印样式表的简短、快捷的指南:http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml
https://webmasters.stackexchange.com/questions/53134
复制相似问题