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

141
Visualizações
Tooltip does not display message

I have a problem with my tooltip. When I do a product search, the information is loaded via javascript. After placing the icon with the tooltip next to the label, it stops working.

Code in HTML:

<label class="fg-label control-label" for="xGrade">Estoque <i class="zmdi zmdi-help zmdi-hc-fw" data-toggle="tooltip" data-placement="top" id="xLocalEstoqueQuantidade" title="" data-trigger="hover"></i></label>

Code in javascript:

document.getElementById('xLocalEstoqueQuantidade').setAttribute('title', suggestion.xNomeEstoqueAtual);
                $('[data-toggle="tooltip"]').tooltip({ trigger: 'hover'});

Sample video: https://www.loom.com/share/96d23f5e191b4c5bae9c0c59068cf120

I want that when you hover the mouse it displays the message

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

0

Your code looks fine, but I am not able to check few things, so please check:

  • dependencies. To display tooltip you need jquery, popper, bootstrap. Be aware the order is important.
  • value that you want to put in the title. Please look if suggestion.xNomeEstoqueAtual object is not empty.

I prepare a workable solution, so it should help you.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<h1>Hello, world!</h1>

<button id="my-special-button" type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="">
  Tooltip on top
</button>


<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<script>
  $(() => {
    $('#my-special-button').attr('title', "Our dynamic data")
    $('[data-toggle="tooltip"]').tooltip()
  })
</script>
</body>
</html>

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