简体   繁体   English

Bootstrap 3-工具提示-按钮-填充消失

[英]Bootstrap 3 - Tooltips - Buttons - padding dissapears

I'm testing Bootstrap and I have a silly problem. 我正在测试Bootstrap,但遇到了一个愚蠢的问题。 When I use tooltips on several buttons (in the same row) at the begining all the buttons are separated by several pixels. 当我在开始时在多个按钮(同一行)上使用工具提示时,所有按钮都被几个像素隔开。 When the tooltip appears then the space between the buttons dissapears. 出现工具提示时,按钮之间的空间消失。

My code: 我的代码:

<button type="button" class="btn btn-default" data-toggle="tooltip" id="btn01"
data-placement="top" title="Tooltip on top">Button with tooltip</button>

<button type="button" class="btn btn-default" data-toggle="tooltip" id="btn02"
data-placement="left" title="Tooltip on left">Button with tooltip</button>

<button type="button" class="btn btn-default" data-toggle="tooltip" id="btn03"
data-placement="right" title="Tooltip on right">Button with tooltip</button>

<button type="button" class="btn btn-default" data-toggle="tooltip" id="btn04"
data-placement="bottom" title="Tooltip on bottom">Button with tooltip</button>

<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.js"></script>

<script type="text/javascript">
    $('document').ready(function() {
        $('#btn01').tooltip();
        $('#btn02').tooltip();
        $('#btn03').tooltip();
        $('#btn04').tooltip();
    });
</script>

Problem already solved adding inside the button tags ... 问题已经解决,在按钮标签内添加...

data-container="body"

By the way ... I still know nothing about JS. 顺便说一句...我仍然对JS一无所知。 I'm learning. 我在学。 So I understand I could add for example the class clsTooltip to the 4 buttons and then ... ¿use this ...? 因此,我知道我可以将例如clsTooltip类添加到4个按钮中,然后...使用此方法...?

$('document').ready(function() {
    $('.clsTooltip').tooltip();
});

Thanks a lot!! 非常感谢!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM