用CSS设置,在打印之前HIDE一下,然后打印之后再显示
解决方案 »
- 如何读取用TDC绑定的数据内容?
- YUI有没有对数组和字符串的扩展?
- 求助 关于两个SELECT的同步
- 本大神自己“研究”的一种保存函数执行结果的写法,其它神马闭包写法都暴弱了!
- 怎么在框架里访问父页面的控件?
- 在页面中嵌入Iframe,Iframe页面表格的每一行都有链接.点击链接时Iframe总是会重新定位到第一行,怎么才可以在点击链接时,Iframe的滚动条保
- 得到一对象,如何判断是什么类型的对象?如javascript对象,html对象?
- 在客户端如何取得客户机的一些软硬件信息?
- event.offsetX和event.clientX的区别
- 如何关闭提示对话框
- (急)Javascript如何将数据写入本地的记事本中???
- 怎样才能去掉close()后窗口不显示提示?(急求解)
function hid(){
document.all.divid.innerHTML="" ;
}
</script>
<div id=divid>
<input type=button name=b value=button><br>
</div>
<input type=button name=print value=print onclick=hid();>
function hid(){
document.all.divid.innerHTML="" ;
}
</script>
<div id=divid>
<input type=button name=b value=button><br>
</div>
<input type=button name=print value=print onclick=hid();>
window.onbeforeprint=p_before
window.onafterprint=p_after
function p_before()
{
ashow.style.visibility="hidden"
}
function p_after()
{
alert("打印完毕");
}
function printit()
{
if (confirm('确定打印吗?')) {
window.print();
ashow.style.visibility="visible"
}
}
</script><body>
<table>
<tr id=ashow name=ashow>
<td align=right>
<input type=button class="button" name=button_print value="打印" onclick="javascript:printit()">
<input type=button class="button" name=button_setup value="打印页面设置" onclick="javascript:printsetup();">
<!--<input type=button name=button_preview value="打印页面预览" onclick="javascript:printpreview();">!-->
<input type=button class="button" name=button_fh value="关闭" onclick="javascript:window.close();">
</td>
</tr>
</table>
@media print {
.btn{visibility:hidden;}
}
</style><input type=button value="上一页" class="btn">
<input type=button value="下一页" class="btn">