简体   繁体   English

单击图像链接时如何打印图像?

[英]How I can print the image when click the image link?

 <div class="grid col-220 cert">
   <a href="images/1.jpg" class="certTop" rel="prettyPhoto[certificates]"><img src="images/thumb/" /></a>
   <a href="images/1.jpg" class="certBottom" ><i class="fa fa-print"></i>Certificate Name </a>
</div>

I want to print 1.jpg when click to the class ".certBottom". 单击类“ .certBottom”时,我想打印1.jpg。 How I can do it with? 我该怎么做?

Use this jQuery code: 使用以下jQuery代码:

$(document).ready(function() {
   $(".certTop").click(function () {
      $(this).append('<img src="images/1.jpg">');
   });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM