$(document).ready(function(){ var timer; ...click(function(){clearTimeout(timer) //... timer =setTimeout(function(){