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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:57:17+00:00 2026-05-23T22:57:17+00:00

I have a tooltip background-image that looks like this: My css is like this:

  • 0

I have a tooltip background-image that looks like this:

tooltip-bg

My css is like this:

p#vtip
{
    display: none;
    position: absolute;
    padding: 10px;
    left: 5px;
    font-size: 13.5pt;
    background:url("tooltip-bg.png") no-repeat;
    border: 0px solid #a6c9e2;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    z-index: 9999;
    height:48px;
    width:140px;
    color:White;
}

p#vtip #vtipArrow
{
    position: absolute;
    top: -10px;
    left: 5px;
}

This is the jquery code:

this.vtip = function() {    
    this.xOffset = -10; // x distance from mouse
    this.yOffset = 10; // y distance from mouse       

    $(".vtip").unbind().hover(    
        function(e) {
            this.t = this.title;
            this.title = ''; 
            this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);

            $('body').append( '<p id="vtip"><img id="vtipArrow" />' + this.t + '</p>' );

            $('p#vtip #vtipArrow').attr("src", 'images/vtip_arrow.png');
            $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow");

        },
        function() {
            this.title = this.t;
            $("p#vtip").fadeOut("slow").remove();
        }
    ).mousemove(
        function(e) {
            this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);

            $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
        }
    );            

};

jQuery(document).ready(function($){
    vtip();
}) 

I then apply the css class to the image on my page:

<div title="Bike" class="vtip">
<img alt="" class="img1" style="width: 248px; height: 163px;" src="bike.jpg" /><br />
</div>

But how do i get the tooltip background to extend or grow as i input more text?

  • 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-23T22:57:18+00:00Added an answer on May 23, 2026 at 10:57 pm

    This is what I could find for you:

    • Using the “chopping” approach you suggested: http://trentrichardson.com/examples/csstooltips/
    • More examples of tooltips (some are just css and don’t use images so you would avoid your current issue): http://coding.smashingmagazine.com/2007/06/12/tooltips-scripts-ajax-javascript-css-dhtml/

    I’d go the CSS way if I were you 😀

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

Sidebar

Related Questions

I have a link with a background image that uses the jQuery tooltip on
I would like to have a tooltip that only comes up when you click
Have been using a simple CSS only tooltip. Working Example css: .tip { position:relative;
I have the following CSS for a div element: .tooltip { padding: .8em; width:
I have a simple tooltip that has the following CSS /* tooltip for buttons
I have written a function that positions a tooltip just above a textbox. The
I have a simple html multiline tooltip implementation: this.tooltip = function(tag) { xOffset =
I have a simple CSS help popup that's been working well for me in
Here's my tooltips markup and CSS: <div class=tooltip>Click here to like it</div> .tooltip {
I have a listview that is binded to a ThreadSafeObservableCollection. The background of each

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.