使用jtopo添加鼠标事件的元素绘制在HTML5的调研

使用jtopo添加鼠标事件的元素绘制在HTML5的调研
画在画布上的东西不能对应的鼠标事件,但它是非常简单的使用jtopo添加事件。这里有一个你可以参考的例子。

使用HTML5时,画在画布上的东西无法对应鼠标事件,但jtopo添加事件很简单,而且效果如下:
代码示例:

复制代码代码如下所示:
var =新jtopo节点。节点(你好);
(409, 269)node.setlocation;
node.mousedown(功能(事件){)
如果(event.button = = 2){
node.text =右;
} else if(event.button = = 1){
node.text =按中键;
} else if(event.button = = 0){
node.text =按左键;
}
});
Node.mouseup(功能(事件){)
如果(event.button = = 2){
node.text =松开右键;
} else if(event.button = = 1){
node.text =松开中间键;
} else if(event.button = = 0){
node.text =松开左键;
}
});
Node.click(功能(事件){)
console.log(点击);
});
Node.dbclick(功能(事件){)
console.log(双重打击);
});
Node.mousedrag(功能(事件){)
console.log(拖放);
});
Node.mouseover(功能(事件){)
console.log(鼠标悬停);
});
Node.mousemove(功能(事件){)
console.log(鼠标移动);
});
Node.mouseout(功能(事件){)
console.log(怪);
});

tag:鼠标事件元素绘制调研电脑软件

相关内容