Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!