Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:54:26+00:00 2026-06-06T03:54:26+00:00

I created a simple tooltip for some buttons in an admin panel I am

  • 0

I created a simple tooltip for some buttons in an admin panel I am developing. I am using some pretty standard JQuery code to position the tooltip just above the button when the user hovers. However, there appears to be some positioning issues with and without the scrollbar present.

With the scrollbar present, the tooltip appears in the correct place…

enter image description here

When there is not enough content for the scroll bar to appear, the tooltop appears to be off by the width of the scrollbar…

enter image description here

It seems strange since I am using offset().left – which shouldn’t be effected by the width of the page. Here is the code I am using…

var ttl;
var tt;
$('.icon').mouseover(function (e) {
    ttl = $(this).attr('title');
    $(this).attr('title', '');

    $('body').append('' +
        '<div id="tt" class="tt">' +
        '   <div class="tttxt">' +
        '   ' + ttl +
        '   </div>' +
        '   <div class="ttnib">&nbsp;</div>' +
        '</div>');
    tt = $('#tt');

    var y = $(this).offset().top - tt.outerHeight();
    var x = $(this).offset().left - (tt.outerWidth() - $(this).outerWidth()) / 2;
    tt.css('left', x + 'px').css('top', y + 'px');
});
$('.icon').mouseout(function () {
    $(this).attr('title', ttl);
    tt.remove();
});

Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:54:27+00:00Added an answer on June 6, 2026 at 3:54 am

    Ok, so I ended up making this work. I was originally appending the tooltip to the body tag. When I added a wrapper div and appended to that, the tooltips align correctly with or without the scrollbar present. Not sure why appending to the body was causing shifts, but at least I got it working.

    UPDATE:

    Shortly after posting this, I found the true culprit. I has 100% height on the wrapper DIV (and some other elements: HTML, FORM). After removing that, all was fixed. I know better than to throw heights around like that, but I was going for an effect. Oh well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help reviewing a basic tooltip using jQuery ui position. The jQuery tooltip
Using VB.NET 2008 desktop project, I created a simple tooltip on Form_Load event and
I created simple code in MVS2010 but it doesn't work. There is just a
Could someone help me on this, I have created simple web services using axis2
I am new to Repository concept and get some questions. I have created simple
I created a simple detail edit form earlier, and decided to data bind some
I have created simple javascript widget where login happens using Facebook Single Sign On.
I have created simple .aspx page which queries a database for some live data
I created simple Silverlight Application using the web site host of the VS2010 (
I've created simple trigger to create cloud table (MyISAM table just to perfor FULL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.