单击时显示 Foundation 5 工具提示
我在跨度上有一个通过基础 5 的工具提示,如下所示:
I have a tooltip through foundation 5 on a span, like so:
<span data-tooltip aria-haspopup="true" class="has-tip tip-top" title="我的工具提示"><i class="fi-pricetag-multiple size-21"></i></span>
这很好用.但是,我想要做的只是在用户单击跨度(而不是悬停)时显示工具提示.然后当您单击关闭按钮时它会关闭.当我添加 data-tooltip-open-event-type="touch"
时,我可以到达一半,但这会添加两个工具提示,当我悬停时它仍然消失.
This works fine. However, what I would like to do is only show the tooltip when a user clicks the span (instead of hovering). Then it closes when you click the a close button. I'm able to get halfway there when I add data-tooltip-open-event-type="touch"
but this adds two tooltips and it still disapears when I hover away.
任何想法将不胜感激.基础 5 没有为交互式内容提供某种弹出窗口,这似乎很奇怪.
Any thoughts would be greatly appreciated. It seems odd that foundation 5 wouldn't have some sort of pop out for interactive content.
谢谢!
我也需要自己解决这个问题.
Just needed to figure this out for myself too.
显示:
Foundation.libs.tooltip.getTip($('#yourId')).show()
隐藏:
Foundation.libs.tooltip.getTip($('#yourId')).hide()