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

前端 未结 10 1855
甜味超标
甜味超标 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 just did something like this and it worked for me:

    html2canvas(document.querySelector("#capture2image"), {
                allowTaint: true,
                useCORS: true,
                logging: false,
                height: window.outerHeight + window.innerHeight,
                windowHeight: window.outerHeight + window.innerHeight, 
    

提交回复
热议问题