我创建了一个 new website (它在子域 atm 上)。但是,文本 Get the FinEco Bookmarklet
上的工具提示未显示。
<span class="bookmarklet"><span class="fa fa-bookmark"></span> Get the
<br>
<a title="" data-original-title="" class="has-tooltip" onclick="return false;" data-toggle="tooltip" data-placement="bottom" data-title="Drag this link to your bookmark bar. Click the bookmark when you want to submit an article." href="javascript:(function(){ window.open('http://fineconomy.com/?link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); })();">FinEco Bookmarklet</a>
</span>
有什么建议吗?
感谢您的回复!
最佳答案
在使用之前,我们需要在 $(document).ready(){})
中初始化 tooltip。
注意到,来自 Bootstrap website ,他们说:
For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself.
One way to initialize all tooltips on a page would be to select them by their data-toggle attribute:
$(function () { $('[data-toggle="tooltip"]').tooltip() })
在您的情况下,请在 ready()
函数中添加 jQuery('[data-toggle="tooltip"]').tooltip()
。它会起作用。
关于html - Bootstrap - 工具提示未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35980822/