我正在尝试在捕获画布上的双击事件时弹出div(其可见性最初设置为隐藏)。它在第一个' double'单击。当我第二次双击相同的画布弹出时,div的高度和宽度将丢失。
我确实尝试将div的显示设置为none并阻止而不是可见性,我注意到div的显示在第二次双击时变为inline-block。我错过了什么吗?
这是我想要做的代码。
calloutCVS.addEventListener('dblclick', function(evt) {
isZoomed = 1;
$('#zoomPopup')[0].style.visibility = "visible";
drawZoomedCanvas();
$('#zoomPopup').popup({
type: 'overlay',
horizontal: 'center',
vertical: 'center',
opacity: 0.3,
escape: true,
blur: true
});
$('#zoomPopup').popup({
onclose: function() {
isZoomed = 0;
$('#zoomPopup')[0].style.visibility = "hidden";
}
});
$('#zoomPopup').popup('show');
}, false);
var drawZoomedCanvas = function() {
var currentDIVID = "zoomPopup";
if (currentDIVID != undefined) {
$('#' + currentDIVID).empty();
}
$("#" + currentDIVID).empty();
var canvasid = "idZoomCVS";
$("#" + currentDIVID).append("<canvas id=" + canvasid + " style='position:absolute;border:1px solid blue;'></canvas>");
}
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="zoomPopup" style="height:80%;width:80%;background:white;visibility:hidden;">
</div>
&#13;