title: how to alternatively resolve and reject jquery object
body: <p>is it possible to resolve a jquery deferred object and then to reject it, and then to resolve it again, etc.
  And to trigger $.when each time it is resolved ?</p>
  
  <p>I am trying this, but it doesn't work :</p>
  
  <pre><code>var bindHide = $.Deferred();
  var bindShow = $.Deferred();
      if ($('#userdata').is(':hidden')) {
          bindShow.resolve();
      } else {
          bindHide.resolve();
      }
      //SHOW USERDATA
      $.when(bindShow).then(function() {
          bindShow.reject();
          $('#miniWeightLevel, #miniWeightLevelTextLayer').unbind('vclick').bind('vclick', function (e) {
              showUserdata();
              $('#miniWeightLevel, #miniWeightLevelTextLayer').unbind('vclick');
              bindHide.resolve();
          });
      });     
      //HIDE USERDATA
      $.when(bindHide).then(function() {
          bindHide.reject();
          $('#minifyCross').unbind('vclick').bind('vclick', function (e) {
              hideUserdata();
              bindShow.resolve();
          });
      });
  </code></pre>