您正在使用 IPV4 [54.81.185.66] 访问本站,您本次已经查看了 1 页
用户名: 密 码: 验证码:     用QQ登录本站
首页 软件 编程 笑话 知识 公告 台风 日历 计算器
悟空收录网       [公益]保护绿色环境,构建和谐社会      

【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中      
[公益] 地球是我家,绿化靠大家      
2024年 清明节 016
2024年 劳动节 043
2025年 元 旦 288
2025年 春 节 316
 
您现在的位置:首页 >> 脚本代码 >> 内容
本类新增
本类热门
js打印方法及代码
内容摘要: 直接调用打印:a href=\'javascript:window.print();\'打印/a 提供打印,预览,设置等按钮: html style media=\'print\'.noprint { display: none }/style/headbodyscript language=\'JavaScript\'function doPrintSet......
直接调用打印:<a href=\"javascript:window.print();\">打印</a>

提供打印,预览,设置等按钮:

<html>

<style media=\"print\">

.noprint { display: none }

</style>

</head>

<body>

<script language=\"JavaScript\">

function doPrintSetup(){

//打印设置

WB.ExecWB(8,1)

}

function doPrintPreview(){

//打印预览

WB.ExecWB(7,1)

}

function doprint(){

//直接打印

WB.ExecWB(6,6)

}

</script>

<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=10 id=WB width=10></OBJECT>

<script >

function window.onload() {

//factory.printing.paperSize = \"A3\"

factory.printing.header = \"\"

factory.printing.footer = \"\"

factory.printing.portrait = false

idPrint1.disabled = false; // enable UI button

idPrint2.disabled = false;

idPrint3.disabled = false;

idPrint4.disabled = false;

factory.printing.leftMargin = 0.75 [Page]

factory.printing.topMargin = 1.5

factory.printing.rightMargin = 0.75

factory.printing.bottomMargin = 1.5

}

</script>

<div class=noprint>

<input id=\"idPrint1\" type=\"button\" value=\"打印本页\"

onclick=\"doprint();\">

<input id=\"idPrint2\" type=\"button\" value=\"页面设置\"

onclick=\"doPrintSetup();\">

<input id=\"idPrint3\" type=\"button\" value=\"打印预览\"

onclick=\"doPrintPreview();\">

<input id=\"idPrint4\" type=\"button\"

onclick=\"window.close()\" value=\"关闭窗口\">

</div>

<br/>

<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" >

<tr>

<td bgcolor=\"#0099ff\">

放入要打印的内容

</td>

</tr></table></body> </html>

版权声明:本内容来源于网络,如有侵犯您的版权,请联系站长,本站收到您的信息后将及时处理。
上一篇:随机信息显示

 

下一篇:显示上传图像的大小

发布日期:2021/6/15
手机扫二维码直达本页
发布时间:12:34:56
点  击:5
录  入:壹家怡园
相关文章
Baidu
YiJiaCMS 7.3.8 build231228(MSSQL) 闽ICP备05000814号-1
本空间由腾讯云(轻量应用服务器)提供,Cloudflare提供加速防护
运行时间载入中.....