我想知道我们是否可以添加另一个动态事件,例如点击、触摸启动等。
前任 :
$('canvas').drawArc({
layer:true,
strokeStyle: '#000',
strokeWidth: 5,
x: 100, y: 100,
radius: 50,
my_event : function(layer)
{
}
});
根据文档,jCanvas 已经原生支持click
and事件。touchstart
您需要做的就是指定click
和touchstart
(分别)作为回调的键名:
$('canvas').drawArc({
layer:true,
strokeStyle: '#000',
strokeWidth: 5,
x: 100, y: 100,
radius: 50,
click : function(layer)
{
},
touchstart : function(layer)
{
}
});