jquery - HTML5 Canvas add id or class -


i'm drawing on canvas.
example:

       '1.01': {         color: 'pink',         points: [563,69,630,69,630,149,563,149]       }, 

where 1.01 text displayed in tooltip when hover on it. points x , y coordinates create block on canvas. possible give drawn block id or class can handle in jquery?

how store in own object , hold collection of these objects later use? although i'm not sure mean "handle in jquery" because on canvas, you're simple filling pixel areas, different when working dom.

var block = function (color, points) {     return {         color: color,         points: points     }; };  var b1 = block('pink', [563,69,630,69,630,149,563,149]); // whatever need it... 

and replace code following keep same reference:

'1.01': b1, 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -