Javascript更新不附加div截图 [英] Javascript to update not append div screenshot

查看:70
本文介绍了Javascript更新不附加div截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要这个脚本来更新而不是追加到画布。当用户单击该按钮时,将创建另一个图像。我需要覆盖图像而不是追加。这是 JS小提琴



我有什么试过:



小提琴是试图找到解决方案来截取div元素的结果。我能够这样做,只需要能够更新并不附加截图。

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.

推荐答案

更新 JSFiddle [ ^ ]



updated JSFiddle[^]

html2canvas(


(#widget),{
onrendered:function (画布){
theCanvas = canvas;
var _canvas =
("#widget"), { onrendered: function(canvas) { theCanvas = canvas; var _canvas =


('canvas')[0];
count ++;
('canvas')[0]; count++;


这篇关于Javascript更新不附加div截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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