Web页面打印:
[code="html"]
function printsetup(){
// 打印页面设置 页面需引入 <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=3></OBJECT>
wb.execwb(8,1);
}
function printpreview(){
// 打印页面预览
wb.execwb(7,1);
}
function printit(div) {
if (confirm("确定打印吗?")) {
document.getElementById(div).style.display = "none";//不用打印的元素隐藏
wb.execwb(6, 6);
}
document.getElementById(div).style.display = "";
}
function closeWin() {
window.opener=null;window.open('','_self');window.close();
}
function goTop() {
$('html, body').animate({scrollTop:0}, 'slow');
}
[/code]
html页面引入:
[code="html"]
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=3></OBJECT>
<div align="center" id="printBT">
<input type="button" value="打印" οnclick="javascript:printit('printBT');" class="btnopr"/>
<input type="button" value="关闭" οnclick="javascript:closeWin();" class="btnopr"/>
</div>
[/code]