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

前端 未结 10 1857
甜味超标
甜味超标 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:42

    Another React Approach...

    On your submit button on click set the document height dynamically, then call html2canvas using document.body as the first argument

    
    

    This will set the html height of public/index.html which html2canvas seems to render from (i.e. not the "root" div).

提交回复
热议问题