不多说 先要引入插件
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/jquery.jqprint-0.3.js"></script>
插件的使用
#print是你要打印区域的盒子
function print() {
$("#print").jqprint({
debug: false, //是否显示iframe查看效果
importCSS: true,
printContainer: true,
operaSupport: false
});
}
打印没有样式加上这句就可以了
<link rel="stylesheet" type="text/css" media="screen,print" href="css/print.css" />
本文介绍如何利用jQuery.jqprint插件实现网页内容的实时打印功能,包括插件的引入、使用方法及如何添加样式。通过简单的代码示例,读者可以快速掌握并应用到自己的项目中。

1万+

被折叠的 条评论
为什么被折叠?



