它显示得很好,但是当我将鼠标悬停在它上面时,它会将每个单元格向右移动。 如何解决? 我附上了两张快照,您可以看到它正在-6ren">
gpt4 book ai didi

javascript - Twitter Bootstrap 的工具提示问题

转载 作者:数据小太阳 更新时间:2023-10-29 06:01:41 25 4
gpt4 key购买 nike

我正在使用 twitter bootstrap 3 来显示 tooltip

<td class = "skills" data-toggle="tooltip" data-placement="left" data-original-title="<?php echo $row['skills']; ?>"><?php echo $row['skills']; ?></td>

它显示得很好,但是当我将鼠标悬停在它上面时,它会将每个单元格向右移动。

如何解决?

enter image description here

我附上了两张快照,您可以看到它正在向右移动。

编辑

我在这里添加了一个测试表,它的作用是在下一个 td 中显示工具提示,并且那个 td 的数据向右移动。

<table id="example-table" class="table table-striped table-hover table-condensed">
<thead>
<th>Serial</th>
<th>Name</th>
<th>Rating</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td data-toggle="tooltip" data-placement="right" data-original-title="A">A</td>
<td>php</td>
</tr><tr>
<td>2</td>
<td data-toggle="tooltip" data-placement="right" data-original-title="B">B</td>
<td>C#</td>
</tr>
</tbody>
</table>

这里是js

 <script type="text/javascript">
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>

最佳答案

我找到了解决方案,只是张贴在这里,以便有一天有人会发现它有用。

因此,如果遇到此问题的任何人,我的意思是如果在使用 twitter-bootstrap tooltip 时在悬停时四处移动数据并且按钮在悬停时反弹,您只需执行以下操作:上一个

<script type="text/javascript">
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>

只需要添加容器(已在 bootstrap 2.3 中修复)

<script type="text/javascript">
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip({container: 'body'});
});
</script>

关于javascript - Twitter Bootstrap 的工具提示问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27823627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com