Bootstrap tooltip floating on the page at random

Asked

Viewed 76 times

-3

How are you guys, all right?
There is a recurring problem with bootstrap TOOLTIP, which does not disappear after removing the mouse and if you scroll the page it goes to the corner of the page as in IMAGE ATTACHED.
This always happens when a div is updated, (via a LOAD) when the mouse is still on hover on the spot.

The tooltip usage code is (Bootstrap v4.3.1):

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

Someone has been there and/or knows how to avoid/resolve it? :)
Thank you!

inserir a descrição da imagem aqui

  • There must be an inconsistency in the DOM of your document and it is conflicting with Tooltip. Try this $('[data-toggle="tooltip"]').tooltip({container:'body'}); that will join you to the <body> bypassing any further conflict. From a read on options supported by Tooltips

  • Vc added the Popper . JS in the project just below the Bootstrap . JS?

1 answer

0

Try changing the selector to the class name or element id you want to have the tooltip.

Ex:

<script>
$(function () {
   $('.my-tooltip').tooltip();
})
</script>

<p class="my-tooltip" >Esse texto deve ter tooltip</p>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.