create screenshot of webpage using html2canvas (unable to initialize properly)

后端 未结 5 2194
醉酒成梦
醉酒成梦 2020-12-01 06:03

I am attempting to use http://html2canvas.hertzen.com/ to take screenshots of my webpage. I am unable to initialize a canvas element using...

var canvas = $         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 06:36

    To just get a part of the page you can use it this way:

    $('#map').html2canvas({
    onrendered: function( canvas ) {
      var img = canvas.toDataURL()
      window.open(img);
    }
    

提交回复
热议问题