E
E
Egor Trubnikov-Panov2014-06-02 15:48:22
JavaScript
Egor Trubnikov-Panov, 2014-06-02 15:48:22

How to determine if the cursor is on an element?

Even if there are still a lot of elements above this element.
And to work in all browsers.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Lesnykh, 2014-06-02
@Aliance

As I understand it, the elements are superimposed on the surface of the desired? Then it's worth trying all the options in this order:
1. css - hover
2. js - onmouseover
3. js - we consider the coordinates of the upper left (1) and lower right (2) corner relative to the upper left corner of the browser. We catch the mouse movement and if event.page* is greater than (1) and less than (2) - then the mouse is over the element (there will be a load)

E
Egor Trubnikov-Panov, 2014-06-02
@EAT

I believe there must be an easier way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question