jquery如何使用printThis.min.js打印网页图片
侧边栏壁纸
  • 累计撰写 611 篇文章
  • 累计收到 0 条评论

jquery如何使用printThis.min.js打印网页图片

加速器之家
2024-08-22 / 0 评论 / 2 阅读 / 正在检测是否收录...

printThis是bootstrap PrintThis打印插件,能实现对前端图片进行打印,使用方法如下:

1、引入jquery和printThis

<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/printThis/1.15.0/printThis.js"></script>

2、在html页面中,放入代码图片标签和按钮标签

<img src="https://www.tpxhm.com/fdetail/995.html" alt="https://www.tpxhm.com/static/tpl/index/foundation/images/bgtx_2.jpg" id="qcodeImg11">
<button type="button">打印</button>

3、jquery代码

<script>
$("#qcodeImg11").printThis();
</script>
0

评论

博主关闭了当前页面的评论