Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need this script to update and not append to canvas. When the user clicks the button another image is created. I need to overwrite the image and not append. Here is the JS Fiddle

What I have tried:

The fiddle is the result of trying to find a solution to take a screenshot of a div element. I am able to do as such, just need to be able to update and not append the screenshot.
Posted
Updated 5-Jan-18 14:29pm

1 solution

updated JSFiddle[^]

html2canvas($("#widget"), {
     onrendered: function(canvas) {
       theCanvas = canvas;
      var _canvas = $('canvas')[0];
      count++;
      $('h2')
      if(_canvas){
      document.body.removeChild(_canvas);
      }

      document.body.appendChild(canvas);
     }
   });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900