use clearTimeout and setTimeout w/ callbacks.

e.g. from my tablefilter code:
          // bind text entry
          $("input", $trInput).each( function(){
            $(this).keyup( function(){
              var input = this;
              var timerCallback = function(){
                filter( input, cache, $table[0] );
                };
              clearTimeout( timer );
              timer = setTimeout( timerCallback, filterConfig.timerWait );
              return false;
              });
            });


On Tue, Oct 20, 2009 at 13:13, wheatstraw <psurr...@gmail.com> wrote:

>
> Hello
>
> In the following code, I would like it delay the "keyup". Does anyone
> have an idea?
>
>        $("#search_query").bind("keyup", function(e){
>                $("#quickresults").slideDown("fast");
>
>                $.post("http://www.wesbite.com";, {search_query:
> $(e.target).val()},
>                        function(result_list){
>                                $("#quickresults > *:not(h3)").remove();
>                                $("#quickresults").append(result_list);
>                        });
>        });
>

Reply via email to