jQuery plugin: delayKeyStroke

Events country style, no hurries lets wait!

Syntax

$(element).delayKeyStroke(Time, EventTimerFired, EventInputCleared);

Parameters

Time			Required. Int that specifies the time in secounds that the event will be delayed.
EventTimerFired		Required. Function that will fire when the last KeyUp event has couted up to the Time parameter. 
EventInputCleared	Required. Function that will fire when the input has a length of zero.

Return Value

none

Remarks

Tested successfully on:
– Firefox > 1.x 
– IE 6.x

Download

Download jquery-plugin-delaykeystroke.js (1kb uncompressed)

Example

<input type="text" id="search" />
<p id="status"></p>
<script>
$(document).ready(function() {
	$('input#search').delayKeyStroke(3,function() {$('p#status').html('Timer has fired');}, function() {$('p#status').html('Input was cleared');});
});
</script>