How can i restart toggle when another button is clicked?
<p>i have 2 buttons each of them has toggle function with 2 function inside the toggle.
i have a problem that i want the toggle to be restarted if the user didn't click on the same button twice for example </p>

<p>if the user clicks on X first function will fires if he clicks on Y and then re-click on X the first function will fires again. but if he clicks on X first function will fires and he clicks on X again then the second function will fires.</p>

<pre><code>$('x').toggle(
   function(){
     //something
   },
   function(){
     //something
   }
}

$('y').toggle(
   function(){
     //something
   },
   function(){
     //something
   }
}
</code></pre>

<p>please tell me your opinions and if there is a solution better than toggle ... please tell me </p>
