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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:52:05+00:00 2026-06-15T20:52:05+00:00

I am using jQuery to create a pop up tool-tip in my jsp. There

  • 0

I am using jQuery to create a pop up tool-tip in my jsp. There is a table with a different hyperlink in each row. When user hovers mouse over the hyperlink, I want the tooltip to be displayed and when user hovers away, I need it to fade away gradually.

I was able to achieve this using below code in IE, but when tried the same page on FF, it is showing a different behaviour. It is actually publishing the content of the tooltip somewhere else on the page and not inside the tooltip box, where it should have been. Also, not removing the content from page on hover away. Please help.

<style>             
#tooltip{
    position:absolute;
    border:1px solid #333;
    background:#f7f5d1;
    padding:2px 5px;
    color:#333;
    display:none;
    width: auto;
}   

/*  */
</style>            
<script type="text/javascript" language="JavaScript">            
    this.tooltip = function(){  
        /* CONFIG */        
        xOffset = 10;
        yOffset = 50;       
        // these 2 variable determine popup's distance from the cursor
        // you might want to adjust to get the right result     
        /* END CONFIG */

        $("a.tooltip").hover(function(e){
            this.t = this.title;
            this.title = "";
            $(body).append("<p id='tooltip' class='tooltip'>"+ this.t +"</p>");
            $("#tooltip")
                .css("top",(e.pageY - xOffset) + "px")
                .css("left",(e.pageX + yOffset) + "px")
                .fadeIn("slow");        
        }, function(){
            this.title = this.t;        
            $("#tooltip").remove();
        }); 

        $("a.tooltip").mousemove(function(e){
            $("#tooltip")
                .css("top",(e.pageY - xOffset) + "px")
                .css("left",(e.pageX + yOffset) + "px");
        });         
    };

    // starting the script on page load
    $(document).ready(function(){
        tooltip();
    });
</script>

The HTML portion generated by the JSP is:

<table width="100%" cellpadding="5px" cellspacing="5px" >
    <tr valign="top" class="h1">
        <td>Version</td><td>Price</td><td>Published</td><td>Edition</td>
    </tr>
    <tr valign="top">
        <td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781857159042" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781857159042' src='/images/jackets/s/18/1857159047.jpg' /></td><td>ISBN: 9781857159042 <br>Version: Hardback <br>Price: &pound;10.99 <br>Publication Date:24 Sep 1992 <br>Publisher: Everyman Everyman's Library</td></tr></table> ">Hardback</a></td><td>&pound;10.99</td><td width=auto align=center>1992</td><td width=auto>New edition</td>
    </tr>
    <tr valign="top">
        <td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781840119688" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781840119688' src='/images/jackets/s/18/1840119683.jpg' /></td><td>ISBN: 9781840119688 <br>Version: Hardback <br>Price: &pound;16.99 <br>Publication Date:01 Sep 2009 <br>Publisher: Templar Publishing</td></tr></table> ">Hardback</a></td><td>&pound;16.99</td><td width=auto align=center>2009</td><td width=auto></td>
    </tr>
    <tr valign="top">
        <td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781841939735" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781841939735' src='/images/jackets/s/18/1841939730.jpg' /></td><td>ISBN: 9781841939735 <br>Version: Hardback <br>Price: &pound;14.99 <br>Publication Date:01 Sep 2011 <br>Publisher: Arcturus Publishing Ltd</td></tr></table> ">Hardback</a></td><td>&pound;14.99</td><td width=auto align=center>2011</td><td width=auto></td></tr><tr valign="top"><td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781853261183" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781853261183' src='/images/jackets/s/18/1853261181.jpg' /></td><td>ISBN: 9781853261183 <br>Version: Paperback <br>Price: &pound;1.99 <br>Publication Date:01 Sep 1993 <br>Publisher: Wordsworth Editions Ltd</td></tr></table> ">Paperback</a></td><td>&pound;1.99</td><td width=auto align=center>1993</td><td width=auto>New edition</td></tr><tr valign="top"><td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781840114881" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781840114881' src='/images/jackets/s/18/1840114886.jpg' /></td><td>ISBN: 9781840114881 <br>Version: Hardback <br>Price: &pound;14.99 <br>Publication Date:01 Oct 2008 <br>Publisher: Templar Publishing</td></tr></table> ">Hardback</a></td><td>&pound;14.99</td><td width=auto align=center>2008</td><td width=auto></td></tr><tr valign="top"><td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9780141023557" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9780141023557' src='/images/jackets/s/01/0141023554.jpg' /></td><td>ISBN: 9780141023557 <br>Version: Paperback <br>Price: &pound;4.99 <br>Publication Date:26 Jan 2006 <br>Publisher: Penguin Books Ltd Penguin Classics</td></tr></table> ">Paperback</a></td><td>&pound;4.99</td><td width=auto align=center>2006</td><td width=auto>New edition</td></tr><tr valign="top"><td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781848770010" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781848770010' src='/images/jackets/s/18/1848770014.jpg' /></td><td>ISBN: 9781848770010 <br>Version: Hardback <br>Price: &pound;14.99 <br>Publication Date:01 Sep 2010 <br>Publisher: Templar Publishing</td></tr></table> ">Hardback</a></td><td>&pound;14.99</td><td width=auto align=center>2010</td><td width=auto></td></tr><tr valign="top"><td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9780956266828" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9780956266828' src='/images/jackets/s/09/0956266827.jpg' /></td><td>ISBN: 9780956266828 <br>Version: Hardback <br>Price: &pound;6.99 <br>Publication Date:28 Oct 2010 <br>Publisher: White's Books Ltd</td></tr></table> ">Hardback</a></td><td>&pound;6.99</td><td width=auto align=center>2010</td><td width=auto></td></tr><tr valign="top"><td><a href="http://botswana.blackwell.co.uk:82/jsp/display_product_info.jsp?isbn=9781906814489" class="tooltip" title="<table><tr><td><img class='jacket' width='75' border='1' alt='ISBN:9781906814489' src='/images/jackets/s/19/1906814481.jpg' /></td><td>ISBN: 9781906814489 <br>Version: Paperback <br>Price: &pound;3.50 <br>Publication Date:02 Jul 2010 <br>Publisher: Classic Comic Store Ltd</td></tr></table> ">Paperback</a></td><td>&pound;3.50</td><td width=auto align=center>2010</td><td width=auto></td>
    </tr>
</table>    
  • 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-15T20:52:06+00:00Added an answer on June 15, 2026 at 8:52 pm

    Your are missing some quotes here:

    $('body').append("<p id='tooltip' class='tooltip'>"+ this.t +"</p>");
    

    I assume that body is defined per default in IE, but not in Firefox. By enclosing it in parenthesis you actually trigger the selector engine of jQuery to search for the element instead of trying to wrap the (non-existant) variable.

    A somehow working example can be found here. Yet your code doesn’t seem to remove the “tooltip”.

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

Sidebar

Related Questions

I am trying to create pop up menu using Jquery mobile, by clicking the
I create one table by using jquery : <div class=productlist style=float:left; id=productlist> <script type=text/javascript
I'm using jQuery to create a dialog that should pop up on top of
New to jQuery, what are the possible ways to create pop up boxes using
I'm trying to parse an XMLRPC response using jQuery to create a table containing
I am using jQuery to create as many input textboxes as the user needs
I am using jquery to create a custom dropdown with the code below. I
I am using jquery to create two sets of tabs on a page. The
I am using jQuery mobile to create the following page. http://ielts.progmic.com/iOS/college.php?title=Royal+College+Of+Arts In the link
I'm using jQuery UI to create a button to a given html element. I'm

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.