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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:23:57+00:00 2026-06-05T13:23:57+00:00

I have a div box and whenever I move over, a tooltip will appear

  • 0

I have a div box and whenever I move over, a tooltip will appear with its corresponding coordinates. What I want is, if I keep on moving inside the div, my tooltip will not be shown, but if I stopped moving then my tooltip will appear. By the way, I am obliged to use mouseover event in jquery because I need to extract the coordinates whenever I move the mouse.

Please help! And please provide me example as well. And as much as possible I don’t want to use plugins.

Thanks!


My progress so far:

<html>
<head>
    <style>
        #box {
            border: 1px solid black;
            width: 900px;
            height: 450px;
            margin: 0 auto;
            margin-top: 50px;
        }

        #tooltip{
            margin:8px;
            padding:8px;
            border:1px solid blue;
            background-color:yellow;
            position: absolute;
            z-index: 2;
            display: none;
        }
    </style>

    <script type="text/javascript" src='/libs/jquery/jquery.js'></script>
    <script>
        $(document).ready( function() {
            var offsetX = 20;
            var offsetY = 10;

            $('#box').mouseover(function(e) {
                var href = $(this).attr('href');
                $('<div id="tooltip"><input type="text" id="coor"/>    </div>').appendTo('body');
            });

            $('#box').mouseout(function(e) {
                $('#tooltip').remove();
            });

            $('#box').mouseenter( function() {
                // alert('entered');
            });

            var x = 0;

            $('#box').mousemove(function(e) {
                $('#tooltip').fadeOut('fast');

                var doIt = function() {
                    $('#tooltip').fadeIn(500);
                }

                setTimeout(doIt, 2500);

                $('#tooltip')
                    .css('top', e.pageY + offsetY)
                    .css('left', e.pageX + offsetX);
                $('#coor').val(e.pageX + '' + e.pageY);
            });
        });
    </script>
</head>

<body>
    <div id="box">

    </div>
    action: <input type="text" id="action" />
</body>

  • 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-05T13:23:58+00:00Added an answer on June 5, 2026 at 1:23 pm

    I think this is what you are after:

    $('.box')[0].onmousemove = (function() {
        var onmousestop = function() {
           $('.box').css('background-color', 'red');
        }, thread;
    
        return function() {
           $('.box').css('background-color', 'black');
            clearTimeout(thread);
            thread = setTimeout(onmousestop, 1500);
        };
    })();
    

    After a delays of 1500ms it will make the box go red, as soon as the user moves the mouse again the box will turn red, just substitute for your own actions.

    jQuery:

    var onmousestop = function (){
        $('.box').css('background-color', 'red');
    }, thread;
    $('.box').on('mouseenter',function (){
        onmousestop();
    }).on('mousemove',function (){
        $('.box').css('background-color', 'black');
        thread&&clearTimeout(thread);
        thread = setTimeout(onmousestop, 3000);
    });
    

    Demo

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

Sidebar

Related Questions

currently i have a hover box appearing whenever i mouse over TITLE, FORMAT. html
I have a div box (black) that will display a few different product images
I have been trying to make a DIV box appear in front of the
I have a div named box which contains three classes. I want to create
I want my div box to have a raquo (») position along the right
I want to include a php file in a div box whenever one generated
Let's say we have a box with some short paragraphs: <div style=overflow:hidden> <p>Some text</p>
Suppose I have div and I want to fetch data and push data into
I have a div with an id of 'gallery' and I want to style
I have object (div-box), and it's draggable (I'm using jQuery). How I can get

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.