Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Location
    Provo, Utah
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mouse events for canvas elements?

    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.

  • #2
    Banned
    Join Date
    Jul 2010
    Posts
    66
    Thanks
    0
    Thanked 1 Time in 1 Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •