Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to hide div when mouse is moving and display when stopped?
    primarykey
    data
    text
    <p>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.</p> <p>Please help! And please provide me example as well. And as much as possible I don't want to use plugins.</p> <p>Thanks!</p> <hr> <p>My progress so far:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; #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; } &lt;/style&gt; &lt;script type="text/javascript" src='/libs/jquery/jquery.js'&gt;&lt;/script&gt; &lt;script&gt; $(document).ready( function() { var offsetX = 20; var offsetY = 10; $('#box').mouseover(function(e) { var href = $(this).attr('href'); $('&lt;div id="tooltip"&gt;&lt;input type="text" id="coor"/&gt; &lt;/div&gt;').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); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="box"&gt; &lt;/div&gt; action: &lt;input type="text" id="action" /&gt; &lt;/body&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload