Event Listeners and Layers

D

djbaker

Alright, I am going to try to be as clear as possible because this
might be confusing.

I have a canvas on top of a div. I need the canvas there so that its
eventlisteners can pick up someone drawing. The div has its own set of
event listeners and the drawing on the top canvas can be toggled. I.e.
you can turn off drawing so that you can instead select and move
something contained within the lower div.

The problem I am having now though is that the eventlisteners on the
lower div won't fire, I am guessing because all the input is being
absorbed by the top canvas.

Is there any way to have the eventlisteners on an element below another
element pick up the user action? I tried using zIndex to move the
layers around when someoen toggles drawing so that the lower div was
ontop and I managed to move the layers, but it broke the event
listeners on both.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top