soulwire / sketch.js

Cross-Platform JavaScript Creative Coding Framework
MIT License
4.09k stars 431 forks source link

Layer Mouse Move #68

Closed hector-jaraba closed 8 years ago

hector-jaraba commented 9 years ago

Hi, i need change the layer for the mouse move event

The scenery is two layers with z-index:

z-index: 1; is the background where the particles are created.

z-index: 2; is the content of the web where the mouse moves.

if the layer on created the particles is the same on the mouse move i can not click in the elements.

sorry for my level of english and thanks for the help!

steve-king commented 8 years ago

I'm having this issue as well.

I would like detect mouse events on a container element, so that my canvas can sit in the background and still react to mouse movements

Container (mouse events detected here)

soulwire commented 8 years ago

You can now pass an eventTarget option (which should be a DOM element) to the constructor and it will bind mouse events to that.

steve-king commented 8 years ago

Brilliant, thanks!

upendersanga commented 6 years ago

how to pass an eventTarget, and where should i place inside Particle Function() Please help me on this.