0

I would like to know if we can add another dynamic event such as click, touchstart etc..

Ex :

$('canvas').drawArc({
  layer:true,
  strokeStyle: '#000',
  strokeWidth: 5,
  x: 100, y: 100,
  radius: 50,
  my_event : function(layer)
  {

  }
});
zeomega
  • 345
  • 2
  • 6
  • 18

1 Answers1

1

According to the documentation, the click and touchstart events are already supported natively in jCanvas. All you need to do is specify click and touchstart (respectively) as the key names for your callbacks:

$('canvas').drawArc({
    layer:true,
    strokeStyle: '#000',
    strokeWidth: 5,
    x: 100, y: 100,
    radius: 50,
    click : function(layer)
    {

    },
    touchstart : function(layer)
    {

    }
});
caleb531
  • 4,111
  • 6
  • 31
  • 41