Bootstrap popover不会显示

时间:2016-11-16 14:25:26

标签: javascript html twitter-bootstrap



$(document).ready(function(){
    $('[data-toggle="popover"]').popover(); 
});

.edit-list-element{
    position: absolute;
    top: 4px;
    left: 214px;
    padding-top: 5px;
    visibility: hidden;
}

 <a href="#" data-toggle="popover" title="List options" data-content="Some content inside popover"><span class="glyphicon list-glyphicon glyphicon-option-horizontal option-list-img"></span></a>
&#13;
&#13;
&#13;

我在这里阅读了很多类似的帖子,但没有提供方法。

1 个答案:

答案 0 :(得分:1)

请确保您已包含运行bootstrap所需的css和脚本。 请检查下面的代码。

&#13;
&#13;
$(function () {
  $('[data-toggle="popover"]').popover()
})
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<a href="#" data-toggle="popover" title="List options" data-content="Some content inside popover"><span class="glyphicon list-glyphicon glyphicon-option-horizontal option-list-img"></span></a>
&#13;
&#13;
&#13;