$.fn.observe = function( time, callback ){
return this.each(function(){
var form = this, change = false;
$(form.elements).keyup(function(){
change = true;
});
setInterval(function(){
if ( change ) callback.call( form );
change = false;
}, time * 1000.0);
});
};
An example:
$("#searchform").observe(1, function() {
$(this).ajaxSubmit("#search_results");
});
This observes the form #searchform, and submits the form via ajaxSubmit when any form elements change. It places the results of the AJAX call in #search_results. Some small modifications could make this more general.
-- Yehuda
On 9/13/06, Daniel Ruiz <[EMAIL PROTECTED]> wrote:
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 doesn't want to use onclick to open a hidden navigation but they also don't like the mouseover because a user may move over it by accident. What they want is something in between so a user can move over a link to open the nav but have to hold it there for a couple of seconds for it to trigger the function to show the nav.
Any ideas would help me a lot thank
Daniel
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
--
Yehuda Katz
Web Developer
(ph) 718.877.1325
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/