南强小屋 Design By 杰米
html加如下代码
<div style="display:none">
<div id="to_print"></div>
<input type="button" id="print_button" value="Print" onclick="document.getElementById('FILEtoPrint').focus(); document.getElementById('FILEtoPrint').contentWindow.print();" />
</div>
<script>
function printSome(path){ //传入文件路径
$("#to_print").html('<iframe src='+path+' id="FILEtoPrint"></iframe>');
setTimeout(function(){$("#print_button").click();}, 500);
}
</script>
web界面添加按钮调用js即可
标签:
jQuery,打印图片
南强小屋 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
南强小屋 Design By 杰米
暂无jQuery打印图片pdf、txt示例代码的评论...