I'm trying to make a slider which goes left and right with the keydown function and replaces a div with content specific to each li. However when yo开发者_高级运维u press the keys too fast in succession then sometimes content either doesn't show or repeats itself as well as the events bubbling up. I've tried a few methods but nothing really works. The URL is http://jackjamesmartin.ninoharris.com/
var wait = false;
function theEvent(){
   if(wait){
     return;
   }
   wait = true;
   do somthing
   //You need to make sure that this is in the callbacks, ie all events are complete.
   wait = false;
  // or setTimeout(function(){wait = false}, xxx )
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论