Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to let mouse events pass through a canvas layer?

Tags:

I have a grid of images and a canvas layer on top of it, I would like to do some animations on the canvas tag once the user rolls over a thumbnail image from the grid, so I wonder if is possible to let mouse events pass through the canvas layer?

like image 875
Ricardo Sanchez Avatar asked Jul 28 '11 15:07

Ricardo Sanchez


1 Answers

Try this css property on your canvas:

pointer-events: none

http://dev.w3.org/csswg/css3-ui/#pointer-events

It is intended to prevent the element from receiving any mouse events at all. Mozilla seems to believe that the event will pass through to elements behind it like you are hoping.

https://developer.mozilla.org/en/CSS/pointer-events

It looks like this may not be supported in IE and Opera, so you might have to disable your animation in those browsers.

like image 144
Eric Mickelsen Avatar answered Oct 01 '22 01:10

Eric Mickelsen