S
S
Symbi0t2014-12-08 16:51:43
Canvas
Symbi0t, 2014-12-08 16:51:43

How to implement hover event on complex shapes?

Greetings.
Tell me how to catch the hover event on complex shapes that are drawn, for example, using Bezier curves. For them after all it will not turn out simply to compare coordinates?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2014-12-08
@Taraflex

Draw shapes with svg (like raphaeljs.com )
and hang the handler like a normal dom element.

V
Vladlen Grachev, 2014-12-08
@gwer

Attach a handler to the mousemove event for the parent element of a rectangular one, which will check if the cursor is inside the required shape (it's up to you how to solve the problem of whether the point belongs to the shape) and, based on this, perform or not perform some actions (simulate hover).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question