Bootstrap tooltip causing buttons to jump

2019-03-08 09:38发布

When I hover over a button and the tooltip appears, the buttons jump. If I disable the tooltip, it does not jump. Additionally, the right button loses the rounded edges. How can I prevent this from happening?

<div class="btn-group">
    <a rel="tooltip" class="btn" href="#" data-title="View Details"><i class="icon-list-alt"></i></a>
    <a rel="tooltip" class="btn" href="#" data-title="Delete"><i class="icon-trash">    </i></a>
</div> 

Javascript:

$('[rel=tooltip]').tooltip();

Working version...

http://jsfiddle.net/BA4zM/147/

Here is a website that has it working without the jumping...

http://wrapbootstrap.com/preview/WB005S479

1条回答
smile是对你的礼貌
2楼-- · 2019-03-08 10:03

To avoid the jump, you need to set the container attribute. This is documented.

When using tooltips and popovers with the Bootstrap input groups, you'll have to set the container option to avoid unwanted side effects.

Try the following:

$('[rel=tooltip]').tooltip({container: 'body'});
查看更多
登录 后发表回答