title: jQuery: Binding and Unbinding Live Click Events
body: <p>So there are two constraints to my question:</p>
  
  <ol>
  <li>I must use an external function call in my click event, and </li>
  <li>I must use a live click event, rather binding a typical click event.</li>
  </ol>
  
  <p>So my problem is that I'm trying to unbind a click event after it occurs, and then rebind it once the click event code is complete. I'm doing this to prevent duplicate clicks while code is currently in process (I have fadeIn/Out animation that will allow the button to be clicked twice or three times rapidly, thereby executing my code 2 or 3 times, which is nto desired). The code I'm using is below:</p>
  
  <pre><code>$item.live("click", handleClick);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>function handleClick(ev) {
  
      $(this).die("click");
  
      // perform code here, including things with 'ev'
  
      $(this).live("click", handleClick);
  }
  </code></pre>
  
  <p>Am I crazy, or should this be working with no problems? Right now, I can click once, but not again afterward. So clearly the die() is working, but it's not being re-bound for some reason to that function. I have verified that it does reach the code in handleClick() to re-bind the live click.</p>
  
  <p>Any ideas? Any help would be greatly appreciated. Thanks.</p>