HTML2Canvas does not render full div, only what is visible on screen?

前端 未结 10 1856
甜味超标
甜味超标 2020-12-13 04:02

I\'m trying to use HTML2Canvas to render the contents of a div. Here is the code:

var htmlSource = $(\'#potenzial-page\')[0];

$(\'#btn\').on(\"click\", fun         


        
10条回答
  •  甜味超标
    2020-12-13 04:25

    I hope thet help you

    html2canvas(htmlSource, {scrollY: -window.scrollY}).then(function(canvas) {
                var img = canvas.toDataURL();
                window.open(img);
            });
    

提交回复
热议问题