我正在尝试使用html2canvas拍摄快照,但是第一次单击该按钮无法正常工作

时间:2019-04-04 05:53:58

标签: javascript jquery

我正在尝试使用html2canvas拍摄某些特定的google graphchart的“快照”,单击按钮时应该拍摄快照,但是第一次单击html2canvas不能拍摄快照时,单击按钮时,我第二次单击相同的按钮,快照工作正常,如果我单击一个新图,它是第一次提供先前快照的快照,我认为这是第一次需要花费很多时间来加载,我们有任何解决方案可供首次加载

我正在尝试为图表绘制快照

var snipshotbutton = "#"+divid+"snipshot"
$(snipshotbutton).click(function() {
    divid2 = "#"+divid

''' 这是html2canvas拍摄快照的部分,但是第一次它没有使屏幕变短

        html2canvas(document.querySelector(divid2)).then(canvas => {newcanvas = canvas});

这是jquery的一部分,它将显示所拍摄屏幕截图的样式

        $("#snipshotnewModal").html(newcanvas);
        $("#snipshotnewModal").modal('show');
    });


I am trying to take the screen shot,onclick of the button for the first time the snapshot is not working, it is failing to show the popup.

0 个答案:

没有答案