Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forwarding Mouse Events through layers/divs

Tags:

Does anybody know of either a jQuery or native JavaScript way to enable mouse events through layers? e.g. enable a link underneath a div.

Other solutions that cannot use in my case:

  • A simple way, although using not really supported pointer-events (edit as of 2017, widely supported)
  • An ExtJS solution
like image 355
davivid Avatar asked Jun 10 '10 14:06

davivid


People also ask

Is mouse a DOM event?

The browser triggers many events. A full list is available in MDN, but here are some of the most common event types and event names: mouse events ( MouseEvent ): mousedown, mouseup, click, dblclick, mousemove, mouseover, mousewheel, mouseout, contextmenu.

Which among the event handler attributes is triggered when the mouse moves on top of an element?

The mouseover event occurs when a mouse pointer comes over an element, and mouseout – when it leaves.


1 Answers

You can do all that or you can just use this CSS for that div:

pointer-events: none

like image 123
Anubhav Gupta Avatar answered Sep 18 '22 21:09

Anubhav Gupta