【发布时间】:2019-12-27 18:10:28
【问题描述】:
当 div 的位置是绝对位置时如何截屏?
我收到错误:“未捕获的 IndexSizeError:索引或大小为负数,或大于允许值”
我想添加 png 图像,一个取决于另一个,所以我使用了 z-index
我的html:
<div id="divFrame">
<img id="frame">
<div id="zoom" class="zoomProps" ><img id="polaroid"/> </div>
</div>
CSS:
.zoomProps {
top: 0;
left: 0;
width: 100%;
z-index: 2;
position: absolute;
}
#frame {
left: 0;
top: 0;
width: 100%;
z-index: 3;
pointer-events: none;
position: absolute;
}
JQuery:
html2canvas(document.getElementById('divFrame'), {
onrendered: function(canvas) {
var img = canvas.toDataURL();
$("#yemekPageImgFullScreen").attr('src', img);
$("#popupBasic").popup();
$("#popupBasic").popup('open');
}
});
【问题讨论】:
标签: jquery html2canvas