3

我想要一个功能来制作 iframe 的快照并附加到网页的其他区域。代码应如下所示:

html:

<iframe src="http://edition.cnn.com/video"></iframe>
<button id="btn_screenShot" name="screenShot">Grab a image</button>
<div id="screenShot-result"></div>

JS:

function screenShot(iframe) {
   //what can I do here?
   //transform the page in <iframe> to a image type, jpeg,png or any other!
}

$('#btn_screenShot').click(function(){
   var imgPath = screenShot(document.getElementByTagName('iframe'));
   $('#screenShot-result').append("<img src=\"+ imgPath +\">");
});

首先,它不适用于 html2canvas,就像描述的限制一样。是否有任何其他javascript或jquery插件来实现该功能?还是可以像键盘上的打印屏幕按钮一样工作?

4

0 回答 0