如何将图像添加到基础工具提示
How to add image to foundation tooltip
我正在使用基础工具提示来显示喜欢 post 的用户。例如这里我需要显示当前用户头像:
span.has-tip data-tooltip="" title="#{image_tag(current_user.avatar)}"Like
但是当我重新加载页面时,我得到一个工具提示:
<img src=
仅此而已。
我应该如何正确使用工具提示中的图像?
如果我在其他地方调用 image_tag(current_user.avatar) 它工作正常。
在 Foundation 6.2.4 中,您需要使用 data-template
属性指定自定义模板(请参阅 http://foundation.zurb.com/sites/docs/tooltip.html#js-options 中的可用选项)。
这看起来像
span.has-tip data-tooltip="" data-template="<div class='tooltip'>#{image_tag(current_user.avatar)}}</div>"Like
在 6.3 版中(将于周四发布 2 周)将有一个选项允许 HTML 直接在您的工具提示中显示内容。
我正在使用基础工具提示来显示喜欢 post 的用户。例如这里我需要显示当前用户头像:
span.has-tip data-tooltip="" title="#{image_tag(current_user.avatar)}"Like
但是当我重新加载页面时,我得到一个工具提示:
<img src=
仅此而已。 我应该如何正确使用工具提示中的图像?
如果我在其他地方调用 image_tag(current_user.avatar) 它工作正常。
在 Foundation 6.2.4 中,您需要使用 data-template
属性指定自定义模板(请参阅 http://foundation.zurb.com/sites/docs/tooltip.html#js-options 中的可用选项)。
这看起来像
span.has-tip data-tooltip="" data-template="<div class='tooltip'>#{image_tag(current_user.avatar)}}</div>"Like
在 6.3 版中(将于周四发布 2 周)将有一个选项允许 HTML 直接在您的工具提示中显示内容。