js网页打印 想问一下各位,用js进行网页打印,可不可以设置打印的字体,比如网页上显示的是“微软雅黑”,打印的时候改换成“宋体”;另外,网页打印的时候可不可以往里面加个logo图片,而网页上不能让它显示logo谢谢各位js打印 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 专门创建一个用于打印的CSS文件,在该文件里设置字体,同时显示logo(logo在普通网页里隐藏)就好了,语法: <link rel="stylesheet" type="text/css" media="print" href="print_style.css" />,该css文件只有在打印时才会起作用,media="print"则表示只在显示器上起作用,请参考http://www.ibm.com/developerworks/cn/web/wa-media/index.html 试试,没有打印机,不知道最终效果是什么就是调用print设置字体和显示logo,然后调用print后再设置为原来的字体和隐藏logo<body style="font-family:微软雅黑"><img id="imgLogo" src="http://www.coding123.net/logo.jpg" style="display:none"/>编程设计网,http://www.coding123.net<br/>编程设计网,http://www.coding123.net<br/>编程设计网,http://www.coding123.net<br/><input type="button" onclick="doPrint()" value="print"/></body><script>function doPrint(){ document.body.style.fontFamily='宋体'; document.getElementById('imgLogo').style.display='inline'; window.print() document.body.style.fontFamily='微软雅黑'; document.getElementById('imgLogo').style.display='none';}</script> 使用js计算工时的问题(高手帮忙) js读取xml html分页显示 全局变量aaaaa如何=function Sub_RSVP(bbbbb) 的问题 求助JavaScript提交表单同时传递多个变量 要这样的一个树形demo 我改半天梅花雪的 没成功 谁有http://jsvm.org/demo/ 的源码 js 设置网页打印的页眉页脚和页边距 一个JS数组遍历循环的问题 关于三级联动的问题!!(急!!!!!!!!!!) 我的IE不能javascript 编写的任何函数,请教高手 怎么根据两个日期得到除节假日 周末外的天数 如果调用并处理第三方网页来判断邮箱的有效性?
<img id="imgLogo" src="http://www.coding123.net/logo.jpg" style="display:none"/>
编程设计网,http://www.coding123.net<br/>
编程设计网,http://www.coding123.net<br/>
编程设计网,http://www.coding123.net<br/><input type="button" onclick="doPrint()" value="print"/>
</body>
<script>
function doPrint(){
document.body.style.fontFamily='宋体';
document.getElementById('imgLogo').style.display='inline';
window.print()
document.body.style.fontFamily='微软雅黑';
document.getElementById('imgLogo').style.display='none';
}
</script>