In order to display a div when someone hovers over a text box for a second, without showing it if the mouse just quickly passes over the text box, the following JavaScript code can be used:
<input type="text" value="Fred" onmouseover="overit()">
<div id="dv" style="display:none">Jim</div>
var delay;
function overit()
{
delay = window.setTimeout('showme();', 1000);
}
function showme()
{
document.getElementById('dv').style.display = 'block';
}
If the gap between the mouseover and mouseout events is less than a second, the showme() function should not be called. To achieve this behavior without using jQuery, the provided solution can be implemented.
For a demonstration of this functionality, refer to the fiddle at http://jsfiddle.net/S4jx4/
Note that jQuery is not being utilized in this particular case.