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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:26:09+00:00 2026-06-14T11:26:09+00:00

I have difficult time figuring out, why this code doesn’t work. My intention is

  • 0

I have difficult time figuring out, why this code doesn’t work. My intention is to display a message when user cliks on tooltip div. After moving mouse cursor out of the div, the tooltip should close.
I need the simplest possble way of displaying a message on a single page. I need to use jquery 1.3.2.Can anybody help? Thank you

<html>
<head>
<script type="text/javascript" src="/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript">

$(document).ready(function(){

    $('.wrapper').live('click', showBox).live('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();
}

</script>
<style>
  .div{ margin:10px;padding:12px;
         border:2px solid #666;
         width:60px;
       }
  </style>
</head>
<body>
<div class="wrapper">sometext</div>
<div class="tooltip">tooltip1</div>
</body>
</html>

EDIT: here is the working code by Juan Mendes http://jsfiddle.net/HUG2Z/3/

  • 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-14T11:26:10+00:00Added an answer on June 14, 2026 at 11:26 am

    I can’t figure out why you’re using live on mouseleave. Without seeing the rest of the code, it doesn’t make sense to use it on click either. live is deprecated in version 1.7 for a reason, so you should not use it, unless you really understand what it’s doing and its drawbacks.

    The following code works http://jsfiddle.net/HUG2Z/1/

    $(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();
        }
    });
    

    If this is now what you want, just change the jsfiddle to better represent your scenario and post it on your question (not as a comment here)

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

Sidebar

Related Questions

I'm having a difficult time figuring out how select() is suppose to work with
i'm having a really difficult time getting this to work... Basically - I have
I'm having a difficult time understanding how to do this. I have two models,
I'm having a difficult time finding definitive information on this. If I have a
I am having a difficult time figuring out how to get AJAX working with
Analyzing the location.hash with this simple javascript code: <script type="text/javascript">alert(location.hash);</script> I have a difficult
I am having a really difficult time figuring out how to get the results
I'm having difficultly figuring out how to write this block of code... function myFunction(x,y,z)
I'm having a difficult time trying to work out how to build a page
I have been having the most difficult time ever with this problem. I have

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.