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

111
Views
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 answers
Answer question

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 Report
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!