A
A
Alex2018-10-28 18:00:05
JavaScript
Alex, 2018-10-28 18:00:05

How to make a similar underline effect?

There is a block on the page with a photo of a group of people standing separately (there are actually several photos and people in each of them in different poses). It is necessary that when you hover over a person, a bar appears below him.
Guidance along the contour, as far as I understand, you can’t do without svg, well, in principle, I was provided with svg in which somewhere is a polygon, somewhere is a path.
I decided that I would make a container with relative positioning, inside I would insert svg and a div that would be a line. When hovering over an object, the div will get top and left. But I can’t figure out how I can get the coordinates of the lower left corner of the object that I pointed to.
Link to jsfiddle
Approximate arrangement of lines when hovering over an object
5bd6a4ca8ec90788272517.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Sartakov, 2018-10-29
@pilolin

https://jsfiddle.net/3gvd2w5z/55/
- complete implementation

P
Pavel, 2018-10-28
@PavelMonro

https://jsfiddle.net/enfernal/3gvd2w5z/33/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question