我在画布上有两个div(请参阅picture),但事件点击不会触发 同时,当我将元素的位置更改为画布外,事件正在进行中
我也使用gojs lib
$(document).ready(function () {
$('#graph-zoomin').click(function (e) {
console.log(e.data);
myDiagram.commandHandler.increaseZoom();
});
$('#graph-zoomout').click(function (e) {
myDiagram.commandHandler.decreaseZoom();
});
});
取值
<div id='DiagramDiv' style='width:100%; height:650px; background-color: #DAE4E4;'><canvas tabindex="0" width="1175" height="650" style="position: absolute; top: 0px; left: 0px; z-index: 2; user-select: none; width: 1175px; height: 650px; cursor: auto;"></canvas></div>
<div id='graph-zoom'>
<div id='graph-zoomin'><i class='fa fa-plus'></i></div>
<div id='graph-zoomout'><i class='fa fa-minus'></i></div>
</div>