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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:44:21+00:00 2026-06-14T10:44:21+00:00

My scenario is described and partially solved here simple tooltips created using jquery 1.3.2

  • 0

My scenario is described and partially solved here simple tooltips created using jquery 1.3.2
I want to show simple tooltip after click on a html element. However, on my page the html code for tooltip (.tooltip) is on different place of my page (bottom).
Now I need it to show right under the clicked html element.
So far the code looks like this:

$(document).ready(function(){

$('.somefield').click(showBox).mouseleave(hideBox);

function showBox(e){
    var x = e.pageX + 20;
    var y = e.pageY + 20;
    $('.tooltip').fadeIn();
    $('.tooltip').offset({ left: x, top: y });
}

function hideBox(){
    $('.tooltip').fadeOut();
}
});

And it works on my page like this http://jsfiddle.net/HUG2Z/15/
How can I achieve to show it right under mouse click in jquery 1.3.2? Thank you very much.

  • 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-14T10:44:22+00:00Added an answer on June 14, 2026 at 10:44 am

    Just make the tooltip be absolutely positioned and change the call to offset() into a css()

    Why are you adding 70 to pageX and pageY? It won’t be right by the mouse like that.

    http://jsfiddle.net/HUG2Z/22/

    $(document).ready(function(){
    
        $('.somefield').click(showBox).mouseleave(hideBox);
    
        function showBox(e){
            $('.tooltip').fadeIn().css(({ left: e.pageX, top: e.pageY }));
        }
    
        function hideBox(){
            $('.tooltip').fadeOut();
        }
    });
    

    CSS

    .tooltip {
        margin:10px;
        padding:12px;
        border:2px solid #666;
        width:60px;
        position: absolute;
        display: none;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While programming, I often come across the following scenario (described in code). I define
Note: The scenario I describe here is not answered in Stack Overflow: Completely manual
Struggled to adequately describe the scenario in the question. I'm trying to learn jQuery
Scenario first :- I'm using Entity Framework to do some queries, to build my
Scenario While using the Maven Ant Task artifact:deploy , I'm encountering the error java.lang.OutOfMemoryError:
I have to accomplish a strange peculiar scenario. Its described as follows: I have
I have a set of request specs written using RSpec2 and Capybara. Here's one
I have a simple solid modeling application in which I want to implement several
I have a scenario like the one I described below... how can I accomplish
Disclaimer : I'm new to web development. Scenario : I've built an application using

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.