...

View Full Version : Mouse events for canvas elements?



happymills
07-17-2010, 09:04 AM
Is it possible to trigger mouse events with shapes drawn in an HTML5 canvas? I want to create a page with drawn elements that you can mouseover and pop up a dialogue box. I also want the shapes to react with some type of feedback. I'm hoping I can do this with javascript instead of Flash but haven't found a way to do it that's simple enough to make it worth it.

santhoshj400
07-22-2010, 01:13 PM
Hi please try with this

function onMouseClick(e) {
var x = e.clientX;
var y = e.clientY;
}
var canvas = dojo.byId(canvasId);
dojo.connect(canvas,"click",onMouseClick);


Hope it helps

Thanks & Regards
Santhosh



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum