Show tooltip only when no modal is open

Asked

Viewed 33 times

0

Hello, I have a screen where in its opening a modal may or may not be open, and also I have a tooltip on the screen that should only appear when the modal is not opened, when the modal opens the tooltip should not appear, but I still could not make it work, i need to test if the modal open then the tooltip should not be shown and if the modal does not open the tooltip should appear. I’m calling the function at: <body onload="ShowTip()"> to show the tooltip and my modal opens by another procedure that is in another framework (intraweb Delphi) AddToInitProc('$(''#CadastroAssistenciaUsuario'').modal(''show'');');

follows my function:

   $(document).ready(function ShowTip() {
          if (($("#CadastroAssistenciaUsuario").data('bs.modal') || {isShown: false}).isShown) {
             $('#bTuto').tooltip('hide');
          } else {
            $('#bTuto').tooltip('show');
          }
        });

But with this function it always shows whether or not the modal has opened...

I appreciate your helpinserir a descrição da imagem aqui

1 answer

0


The tooltips are not displayed in :hover when modals are open.

Anyway, if you display it, you can hide it when the modal is opened, using:

$(document).on('show.bs.modal', '.modal', function () {
  $('button').tooltip('hide');
});

This causes the tooltip to be hidden when the modal is opened. See an example here: https://jsfiddle.net/azweq0L1/

  • If my question helped you, consider marking it as solved.

  • 1

    Hello Peter! Yes helped me a lot! Thank you, sorry I didn’t come to comment before! Thank you!

Browser other questions tagged

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