Rebind an event with condition
<p>Q: How to rebind an event with condition?</p>

<p>I have a variable that check a box is opened or closed. Like Below</p>

<pre><code>variable isOpened is true;

When TheEvent has been called:
   if (isOpened is false)
      open that;
      isOpend is true;
   else
      close that;
      isOpend is false;
</code></pre>

<p>I cant check the variable in the event, 'cause the close and open event can be different, So:</p>

<pre><code>variable isOpened is true;
if(isOpened is true)
   When OpenEvent has been called:
      ....
else
   When CloseEvent has been called
      ....
</code></pre>

<p>It's works, but the problem is: if the close event and open event be same, that doesnt work: look at <a href="http://jsfiddle.net/6uy7N/1/" rel="nofollow">this fiddle</a></p>

<p>I tried unbind and rebind the event but it doesn't work either.</p>

<p>Thanks</p>
