Is there a way to share a popper.js popper with multiple targets?

1k views Asked by At

I am make a tooltip that will be triggered by multiple elements. Minor details in the tooltip will be changed by each trigger elements. My question however is, is there any way to create a single tooltip, that can be triggered by more than one element?

1

There are 1 answers

0
Zhdanown On

You may want to take a look at virtual elements https://popper.js.org/docs/v2/virtual-elements/.
With this you can have one object which holds tooltip's coordinates and then later in the code you can trigger the change of coordinates from other elements.