html jquery - 在页面中打印特定图像 [英] html jquery - print specific image in page

查看:274
本文介绍了html jquery - 在页面中打印特定图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < a href =javascript:window.print( )>打印QR码< / a> 

当用户点击它时,它会按照您的想法打印整个页面..可悲的是,它根本不打印QR码。如何指定我想要打印的内容?比如,让我们说我想在页面上打印一个特定的图像?

解决方案

我发现了这个插件: / p>

http://projects.erikzaadi。 com / jQueryPlugins / jQuery.printElement /

  $('img#some_id')。printElement(); 


I have an html page with a link like this:

<a href="javascript:window.print()">Print QR code</a>

When a user clicks it, it does what you think it will.. prints the whole page.. sadly, it does not print the QR code at all. How do I specify what I want to print? Like, lets say I want to print a specific image on the page?

解决方案

I found this plugin that does the trick:

http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/

$('img#some_id').printElement();

这篇关于html jquery - 在页面中打印特定图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆