title: Bootstrap carousel: prevent next/prev or indicator buttons while animating
body: <p>I am trying to make a small function to stop the next/prev buttons and indicators from sliding around while the carousel is animating.</p>
  
  <p><a href="http://jsfiddle.net/cG8j8/" rel="nofollow">JSFiddle Example</a></p>
  
  <p>I've tried:</p>
  
  <pre><code>$('.carousel').on('slid',function() {
     var carousel = $(this);
     function preventClick() {
         carousel.on('click','.carousel-indicators li, .carousel-control', function() {
              return false;
         });    
     }
  
  
     function releaseClick() {
         setTimeout(function() {
             carousel.on('click','.carousel-indicators li, .carousel-control', function() {
                 return true;
             });
         }, 2000);    
     }
     preventClick(); releaseClick();
  });
  </code></pre>
  
  <p>Any idea why this doesn't work? Or perhaps you have a better idea?</p>