There is no onprint action in Javascript that I am aware of.
The key is to use css:
Note: In css '#' denotes an ID selector, '.' denotes a class selector.
<style type="text/css">
@media print
{
div.headerbox{ display:none; }
}
</style>
<div class="headerbox">...
hidden when printed
</div>
<div class="otherbox">...
not hidden when printed
</div>
or
<style type="text/css">
@media print
{
div#headerbox{ display:none; }
}
</style>
<div id="headerbox">... hidden when printed</div>
<div id="otherbox">... not hidden when printed</div>
No comments:
Post a Comment