Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip issue with twitter bootstrap

I'm using twitter bootstrap 3 to display tooltip

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

and it shows well but when I hover on it, it shift each cell to right.

how to fix that?

enter image description here

I've attached two snapshots and you can see it's shifting towards right.

Edit

I'm adding a test table here, what it does, displays tooltip in next td and data of that td shifted right.

<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>

and here is js

 <script type="text/javascript">
    $(document).ready(function(){
        $('[data-toggle="tooltip"]').tooltip();   
    });
 </script>
like image 621
MMK Avatar asked Jan 07 '15 16:01

MMK


1 Answers

I found the solution, just posting here so that someone may find this useful some day.

So, anyone if faces this issue, I mean if moving data around on hover and buttons bounce on hover while using twitter-bootstrap tooltip, you just need to do the following: Previous

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

just need to add container(fixed in bootstrap 2.3)

<script type="text/javascript">
   $(document).ready(function(){
     $('[data-toggle="tooltip"]').tooltip({container: 'body'});   
   });
</script>
like image 99
MMK Avatar answered Oct 04 '22 11:10

MMK