javascript - Adding bootstrap tooltip modifies the style of the element itself - how do I stop this happening? -
i'm trying add tooltips existing page. use bootstrap 2.3 seemed obvious choice.
my html looks this, say:
<script> //initialize tooltips $(document).ready(function(){ $('.my_button').tooltip(); }); <div class="my_button_row"> <a href="www.google.com" data-placement='bottom' data-toggle="tooltip" title="some helpful text here!" class="my_button my_button_green">buttonnnnn</a> </div> and css looks like:
.my_button_row{ height: 100px; border-bottom: 1px solid #e5e5e5; width: 500px; display: table; border-collapse: separate; border-spacing: 20px 5px; } .my_button { background: linear-gradient(to bottom, #3facf5, rgba(56, 101, 131, 0.76)) repeat scroll 0% 0% #3498db; border-radius: 34px; box-shadow: 4px 4px 4px #666; color: #fff; font-size: 26px; padding: 10px 10px; text-decoration: none; display: table-cell; margin: 10px; white-space: normal !important; word-wrap: break-word; text-align: center; vertical-align: middle; height: 100px; max-width: 180px; min-width: 15%; line-height:26px } .my_button_green{ background: linear-gradient(to bottom, #63f53f, rgba(79, 131, 56, 0.76)) repeat scroll 0% 0% #61db34 } when mouseover button, tooltip displayed wanted first time, styling on button appears change - can see jsfiddle - how can stop happening?
edit: prefer solution doesn't involve totally changing way page laid out (i.e. 'just remove 'display:block container element' much less straightforward solution simplified jsfiddle make appear ) - solution doesn't modifying html ideal.
delete display: table; .my_button_row{ ... or add
data-container="body" to
<a href="www.google.com" data-placement='bottom' data-container="body" data-toggle="tooltip" title="some helpful text here!" class="my_button my_button_green">buttonnnnn</a>
Comments
Post a Comment