我甚至不知道如何做到这一点,html2canvas的文档在这部分并没有真正的帮助.
我可以用这一小段代码制作我的html截图:
target = $('#myDiv');
html2canvas( target, {
onrendered: function( canvas ) {
/* canvas is the actual canvas element,
to append it to the page call for example
*/
document.body.appendChild( canvas );
}
})
Run Code Online (Sandbox Code Playgroud)
但我希望能够传递一个网址并制作此页面的屏幕截图.就像他们在他们的示例页面中所做的那样:http://html2canvas.hertzen.com/screenshots.html
如果有人能给我一个提示如何开始,我会很高兴.