On Sep 14, 2006, at 2:04 PM, Lewis, David wrote:I think that this should be possible by creating a time delay function [setTimeout()] that is started on the mouseover event and cancelling the timer delay function [clearTimeout()] on the mouseout eventI've done just such a thing with jQuery, but in
Is there any way in jquery to do something like this?
if mouseover for 2 seconds then do this, else do nothing
Basically the client I have doesnt want to use
onclick to open a hidden navigation but they also dont like the
mouseover because a user may move over it by accident. What they
Hi there,well you have the function hover() and you can use it like this:$(#link).hover(function() {//Will be executed when you mouse over//Set a timer that will wait for 2 secswindow.setTimeout
(function() {$(#navigation).show(); //Show navi), 2000);},function() {//Will be executed when you move
Paul Bakaus schrieb:
Hi there,
well you have the function hover() and you can use it like this:
$(#link).hover(function() {
//Will be executed when you mouse over
//Set a timer that will wait for 2 secs
window.setTimeout (function() {
$(#navigation).show(); //Show navi
), 2000);
},
The code John posted regarding Form.observer is a good step in the right direction. I made some tweaks: $.fn.observe = function( time, callback ){ return this.each(function(){ var form = this, change = false;
$(form.elements).keyup(function(){ change = true; }); setInterval(function(){ if (
Hi,
I guess he needs something like this:
$(#link).hover(function() {
$(#navigation).each(function(){this.donthide = true;})
this.timeout = window.setTimeout(function()
{$(#navigation).show();},2000);
},
function() {
// if we move out of the link before the timout has