Lef*_*nos 1 html javascript css media printing
我使用下面的脚本:
<script>
function printpage()
{
window.print()
}
</script
Run Code Online (Sandbox Code Playgroud)
用此之后调用它:
<input type="button" value="Print this page" onclick="printpage()" />
Run Code Online (Sandbox Code Playgroud)
但我不知道如何在脚本中插入这个:
$('input' )
.hide();
Run Code Online (Sandbox Code Playgroud)
这意味着隐藏了打印区域的所有输入.
有任何想法吗?
Dan*_* Li 12
您可以使用CSS通过将媒体类型指定为print:
<style type="text/css" media="print">
/*<![CDATA[*/
input{
display:none;
}
/*]]>*/
</style>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
508 次 |
| 最近记录: |