工具提示显示标准工具提示

时间:2018-02-22 20:19:35

标签: bootstrap-4 twitter-bootstrap-tooltip font-awesome-5

$(function () {
  $('[data-toggle="tooltip"]').tooltip()
})
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<span class='fas fa-print' data-toggle='tooltip' data-placement='bottom' title='Print'>Printing</span>

在此代码中,spantooltip切换,当我将鼠标悬停在其上时,

它显示Bootstrap Tooltip然后直接显示Standard Tooltip,b

他们两个都显示出来,究竟是什么问题?

1 个答案:

答案 0 :(得分:5)

我认为字体真棒svg搞砸了。将图标包装在工具提示的单独范围内...

<span data-toggle="tooltip" data-placement="bottom" title="Print">
   <span class="fas fa-print">Printing</span>
</span>