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

  • SEARCH
  • Home
  • 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 1044965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:54:45+00:00 2026-05-16T15:54:45+00:00

I have created a tooltip that appends a DIV with text to the page.

  • 0

I have created a tooltip that appends a DIV with text to the page.

I have managed to get it to appear in the position i want and follow the mouse as it moves.

I was previously doing this with inline styles and updating the top, left absolute positioning co-ordinates dynamically inline.

This seems to cause performance issues so i wrote the dynamic styling to a <style> in the <head> of the dosument which works fine in Firefox but now not in IE7 or IE6.

The jsFiddle is here;

http://jsfiddle.net/SBhnc/7/

I guess i need to remove the tag from the on mouseout as well but IE seems to render it once and then always again in the same position.

I would obviously like it to work in all browsers and not suffer any massive performance hits like it was when writing inline styles.

  • 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-05-16T15:54:45+00:00Added an answer on May 16, 2026 at 3:54 pm

    Not sure exactly where to start, so how about my changes? As you can see, it now works just fine in Internet Explorer. Explanations for each change:

    • Internet Explorer allows a maximum number of StyleSheets (31 or 32, I think) and on your mousemove event you were appending a new <style> element to the head. When it reaches the limit the tooltip never moves again. I switched it back to css() for you.
    • Every time you mouseover the elements, you attach a new mousemove event. The problem here is that you never unbind this handler, so mouse off, mouse on causes a new handler to be attached each time, doubling the work being done and over-stressing the browser (poor IE!). I moved the mouseover handler to it’s own space where it’s only created and attached once.
    • Each mouseover would create the tooltip, then on mouseoff you detach it. Much better to have it in the DOM to start with, just hide() and show() it.
    • You don’t do any caching of selectors or variables. Each time you write $('#tooltip') it’s an extra lookup. Save the result of $('#tooltip') to a variable and use the variable.

    I did some of the work caching $('#tooltip'), but you should do the same for $(this). mousemove is a fairly stressful event, and can be called many times within a few ms. This causes slowdown on the rendering because it waits for the script to complete.

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

Sidebar

Related Questions

I want to have a tooltip that shows different things when the mouse goes
I have created some JQuery that will expand a div 'popup' on hover and
I have created a custom tooltip that is shown for WPF controls, but not
I have created a RibbonButton and given its Tooltip this way <ribbon:RibbonButton Label=My Label
I have created a asp.net website and i added tooltip to a button by
I have created an android application that calls (using kSOAP library) a SOAP based
I have created a custom post type named People. I have created a page
I have a dataTable that uses pagination. Now when my page loads then my
I have an image button that is created on rowcreated manually in code. Dim
I created a custom UserControl that displays itself in a ToolStripDropDown to emulate ToolTip

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.