简体   繁体   English

有没有办法与多个目标共享 popper.js popper?

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

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?然而,我的问题是,有没有办法创建一个可以由多个元素触发的工具提示?

You may want to take a look at virtual elements https://popper.js.org/docs/v2/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.有了这个,您可以拥有一个 object 来保存工具提示的坐标,然后在代码中您可以触发其他元素的坐标更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM