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

102
Visualizações
Tooltip on contents loaded after page loading

I'm using jQuery and Bootstrap to design a page where user selects a category and then related info is loaded on a div, and on this div I need tooltip.
My code works for static page, where the info is loaded with the page itself, but can't make it work for contents which are loaded after that.
I tried to replicate the desired result below using paint

Initial page
Page loaded based on selected radio

Now on this page I need tooltip Loaded content with tooltip
Unfortunately my code stops working here, and no tooltip is shown, no request is made to tooltips.php

jQuery used to load tooltip contents

$(document).ready(function(){
$( ".content span" ).tooltip({
    track:true,
    open: function( event, ui ) {
          var id = this.id; 
          var userid = $(this).attr('data-id');            
          $.ajax({
              url:'tooltips.php',
              type:'post',
              data:{userid:userid},
              success: function(response){
                  $("#"+id).tooltip('option','content',response);
                    
              }
          });
    }
});

$(".content span").mouseout(function(){
    $(this).attr('title','Please wait...');
    $(this).tooltip();
    $('.ui-tooltip').hide();
}); 
});

function load(id) {
$.ajax({
url: 'content.php',
type: 'post',
data: {id: id},
success: function(response){ 
$('.modal-body').html(response);
$('#itiModal').modal('show'); 
  }
 });
}

Sample HTML which is loaded on Load button via load() from content.php

<div class='content'><span title='Please wait...' data-id='2' id='user_2'>Spiderman</span>/div> some text with other text 
<div class='content'><span title='Please wait...' data-id='3' id='user_3'>Spiderman-2</span></div>

Sample output from tooltips.php which should be shown in tooltip

<span class='head'>Name : </span><span>Tobey</span><br/>
about 4 years ago · Juan Pablo Isaza
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