title: jQuery onClick execution
body: <p>I have this bit of javascript written with jQuery 1.2.5.  It's contained inside the main function() of a plugin that I wrote.  The plugin is a horizontal gallery scroller very similar to jCarousel.  It does alot of auto calculating of widths and determines how many to scroll based on that and the size of the images, which is what all the calculations are that are going on.</p>
  
  <p>What my question is, how do I prevent this from firing off before a previous execution is finished.  For instance, if I get a little click happy and just frantically mash down on <code>.digi_next</code>.  Things don't go so well in the UI when that happens and I'd like to fix it :)  I thought the answer might lie in <code>queue</code>, but all my attempts at using it haven't turned out anything worthwhile.</p>
  
  <pre><code>    var self = this;
      $(".digi_next", this.container).click(function(){
  
          var curLeft = $(".digi_container", self.container).css("left").split("px")[0];
          var newLeft = (curLeft*1) - (self.containerPad + self.containerWidth) * self.show_photos;
  
          if (newLeft &lt; ((self.digi_gal_width - (self.containerPad + self.containerWidth) * self.show_photos)) * -1) {
              newLeft = ((self.digi_gal_width - (self.containerPad + self.containerWidth) * self.show_photos)) * -1;
          }
  
          $(".digi_container", self.container).animate({
              left: newLeft + "px"
          }, self.rotateSpeed);
      });
  </code></pre>