简体   繁体   中英

Get screenshot of div with html2canvas and show the image

I've read all the topics about html2canvas and I still don't get it. I have only 1 div with a content that I wanna convert to the image and 1 "PrintScreen" button that should do it. So how to do it? I tried almost every snippet I found and still nothing... Any help would be great and appreciated!

You can do it by putting this in the section of your page:

<script type="text/javascript">
 function setUp(){
   h2cSelector = '#bar';
 }      
</script>

Also you change check this example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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