代码示例:
复制代码
代码如下:
VAR node = new JTopo.Node("Hello");
node.setLocation(409, 269);
node.mousedown(function(event){
if(event.button == 2){
node.text = '按下右键';
}else if(event.button == 1){
node.text = '按下中键';
}else if(event.button == 0){
node.text = '按下左键';
}
});
node.mouseup(function(event){
if(event.button == 2){
node.text = '松开右键';
}else if(event.button == 1){
node.text = '松开中键';
}else if(event.button == 0){
node.text = '松开左键';
}
});
node.click(function(event){
console. LOG ("单击");
});
node.dbclick(function(event){
console.log("双击");
});
node.mouse Drag (function(event){
console.log("拖拽");
});
node.mouseover(function(event){
console.log("mouseover");
});
node.mou SEM ove(function(event){
console.log("mousemove");
});
node.mouseout(function(event){
console.log("mouseout");
});
总结
以上是 为你收集整理的 使用jTopo给Html5 Canva中绘制的元素添加鼠标事件 全部内容,希望文章能够帮你解决 使用jTopo给Html5 Canva中绘制的元素添加鼠标事件 所遇到的问题。
如果觉得 网站内容还不错, 推荐好友。
查看更多关于使用jTopo给Html5 Canva中绘制的元素添加鼠标事件的详细内容...