Home > front end >  Child elements and the parent element overlap in full, how to handle events.
Child elements and the parent element overlap in full, how to handle events.

Time:04-19

Ladies and gentlemen, I put a div container, canvas is put inside, the position of the two size is the same
I hope drag div, of course, canvas is event,
I don't want canvas processing events, div only handle events, which is only drag div,
Results the canvas being dragged, div is not drag,

All is my own design, div chiildren unbind the mouse events,
Found that div onm ousemove is invoked,
But e. arget is canvas,
This all messed up,
Could you tell me how to solve this problem, change

Child elements and the parent element completely overlap, let the child element to ignore events, the parent element processing events, the father: div, son: canvas
  • Related