您的位置:首页 > Web前端 > JavaScript

print control with css and javascript

2005-12-16 12:34 483 查看
Sometimes we have to print a web document without some elements on it.
We can utilize gumptious css style or JavaScripts to accomplish this task that seemed be difficult.
1)css:
css style part:

<style media=print type=css/style>
.NotPrint {display:none}
</style>

html part:
<div class=NotPrint id="NotPrintPart">
<!--some innerHtml !-->
</div>
function onBeforePrint()
2
8function onAfterPrint()
9
15
html part:

<body onBeforePrint="onBeforePrint()" onAfterPrint="onAfterPrint()">



<div id=NotPrintPart ></div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐