Skip to content

Instantly share code, notes, and snippets.

@dandelionmood
Created August 3, 2010 14:33
Show Gist options
  • Save dandelionmood/506473 to your computer and use it in GitHub Desktop.
Save dandelionmood/506473 to your computer and use it in GitHub Desktop.
Attendre X millisecondes avant d'effectuer une opération Javascript
Event.observe(window, 'load', function() {
var timer;
$('recherche').observe('keyup', function() {
clearInterval(timer);
timer = setInterval(
function() {
clearInterval(timer);
// Suite des opérations ici ...
},
100 // Délai avant d'effectuer l'opération.
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment