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 8761327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:15:32+00:00 2026-06-13T15:15:32+00:00

The new version of jQueryUI (1.9) comes with the native tooltip widget. After testing

  • 0

The new version of jQueryUI (1.9) comes with the native tooltip widget. After testing with it, it works fine if the content (value of the title attribute) is short. But if the content is long, the tooltip, once displayed, will overlap the input text.

There is a demo on the official site.

When you hover the mouse cursor over the Your age text <input>, the tooltip displayed overlaps the text input. I am not sure if this is the desired behaviour of the widget.
I would like it to stay on the right side of the text input and break lines if necessary.

Edit: The demo page no longer shows the original problem since the demo has been updated to use jQueryUI v1.10 in which the position code was updated to better place the tooltip – see http://api.jqueryui.com/tooltip/#option-position

I have re-created a demo of the original problem on jsFiddle.

  • 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-13T15:15:33+00:00Added an answer on June 13, 2026 at 3:15 pm

    The placement of the tooltip is controlled by a jQueryUI Position object and the default settings are:

    { my: "left+15 center", at: "right center", collision: "flipfit" }
    

    The Position Object, in particular the collision attribute can be changed to force placement of the control somewhere else. The default for tooltips is flipfit which means the if the default (on the right) does not fit it will flip to the left and try that position and if that doesn’t collide with anything, try to fit the control by moving it away from the edge of the window. The result is that it now collides with the <input>. There doesn’t seem to be an option to force a long tooltip to cleverly wrap.

    However there are two ways to wrap the content:

    Add a custom CSS class to the configuration with a max-width to force wrapping, for example:

    JavaScript

    $('input').tooltip({
        tooltipClass:'tooltip'
    });
    

    CSS

    .tooltip {
        max-width:256px;
    }
    

    Or insert hard line-breaks <br/> in the title attribute, for example

    title="Lorem ipsum dolor sit amet,<br/>consectetur adipisicing elit"
    

    Edit: So it looks like jQueryUI changed the tooltip content option between v1.9 and v1.10 (according to the changelog). For reference here is the difference:

    v1.9.2

    content: function() {
        return $( this ).attr( "title" );
    }
    

    v1.10

    content: function() {
        // support: IE<9, Opera in jQuery <1.7
        // .text() can't accept undefined, so coerce to a string
        var title = $( this ).attr( "title" ) || "";
        // Escape title, since we're going from an attribute to raw HTML
        return $( "<a>" ).text( title ).html();
    }
    

    So you can put back the older functionality that does not escape <br/> tags in the title attribute by using the .tooltip() like this:

    $('input').tooltip({
        content: function() {
            return $(this).attr('title');
        }
    });
    

    Also, see jsFiddle demo.

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

Sidebar

Related Questions

Starting with a recent new version of ADT, I've noticed this new attribute on
With jquery-ui-1.7.x.js version works fine, but with newer version 1.8.x it gives me error
I added a new version of my data model and changed one attribute from
With each new version of the Android Developer tools comes new project setups. Is
The new version of SQLite has the ability to enforce Foreign Key constraints, but
I installed a new version of Apache server, I used options like --with-PACKAGE to
In the new version of Bouncy Castle library there are changes in PKCS10CertificationRequest .
I just submitted a new version of our app to the Apple app store,
I've a new version of an App that's ' waiting for review' and when
When a new version of a framework or language appears (e.g. .NET 3.5, SQL2008),

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.