Put the div after another, but still showing higher?

Well, this question may seem a bit confusing, or at least esoteric, but I will try my best to clarify it.

My charting application has a div that is used as a tooltip for tooltips. This tooltip appears when you hover over a datapoint and get some information. I used z-index to make the tooltip above the underlying div chart. However, the base diagram has interactivity with mouse events, so is it possible to have basic event data in the graph, even if the mouse hangs over the tooltip?

+3
source share
4 answers

In fact, in browsers that support css3, pointer-events is the easiest solution. :)

0
source

You can capture the mouse event, taking into account the coordinates, and then add these coordinates to the actual position of the tooltip relative to the page. Then you can restart the fake MouseEventusing these coordinates, minus the coordinates of the base div element in the base element.

+2
source

, , . div . , , .

+2

I don’t know how practical or not it is in your situation, but you can add a tooltip as a child to the data point. Thus, it is still part of the schedule.

+1
source

Source: https://habr.com/ru/post/1756291/


All Articles