Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

113
Visualizações
Custom tooltip not showing

I have a table like this:

<tr data-id="{{ $user->id  ?? '' }}" data-name="{{ $user->name ?? '' }}">
  <td>{{ $user->id }}</td>
  <td><a class="information text-danger float-left"><i class="fa fa-info-circle"></i></a>{{ $user->name }}</td>
</tr>

As you can see I have passed data-id and data-name to <tr>.

And this is the script for showing those information on Tooltip:

$(document).on('mouseover', '.information', function() {
  let elementMouseOver = $(this);
  
  elementMouseOver.tooltip({
    title: "<table class='table table-responsive table-borderless text-light'>" +
      "<tr><td>UserId:</td><td>" + elementMouseOver.closest('tr').attr('data-id') + "</td></tr><tr><td>UserName:</td><td>" + elementMouseOver.closest('tr').attr('data-name') + "</td></tr></table>",
    html: true,
    placement: "left",
    container: 'body'
  });
});

Then I've added this style:

.tooltip-inner {
  max-width: none;
  white-space: nowrap;
  background: #000000;
  -webkit-box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.3);
  -moz-box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.3);
  box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.3);
  color: gray;
  margin: 0;
  padding: 0;
}

So now it should be showing the information but it's not.

In fact when I console.log the elementMouseOver.closest('tr').attr('data-id') and elementMouseOver.closest('tr').attr('data-name'), they properly appears.

There must be a problem with the CSS part that does not show the Tooltip.

So if you have any idea about this, please let me know...

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

$(document).on('mouseover', '.information', function() {
  let elementMouseOver = this.value;
  
  if(elementMouseOver === true)
{
  elementMouseOver.tooltip({
    title: "<table class='table table-responsive table-borderless text-light'>" +
      "<tr><td>UserId:</td><td>" + elementMouseOver.closest('tr').attr('data-id') + "</td></tr><tr><td>UserName:</td><td>" + elementMouseOver.closest('tr').attr('data-name') + "</td></tr></table>",
    html: true,
    placement: "left",
    container: 'body'
  });
}
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda