我正在尝试使用Bootstrap弹出窗口。它确实会弹出,但是它不会出现在我的按钮附近,并且我不知道为什么。

的HTML

<div class="row">
    <div class="col-sm-12">
        <button type="button" class="btn btn-default" id="example1"
                data-trigger="click" data-container="body"
                data-toggle="popover" data-placement="top"
                data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
          Popover on top
        </button>
    </div>
</div>

<div class="row">
    <div class="col-sm-12">
        <h3>Client search</h3>
        <div class="input-group col-sm-5">
            <input placeholder="Search for ..." id="search_box" name="search_box"
                   title="Search for ..." class="form-control"  type="text" value="">
            <span class="input-group-addon">
                <i class="glyphicon glyphicon-search"></i>
            </span>
        </div>
    </div>
</div>


jQuery查询

$('#example1').popover();


屏幕截图

最佳答案

希望这可以帮助

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
  Popover on top
</button>


您可以查看详细信息http://getbootstrap.com/javascript/#popovers

10-08 20:25