title: Determine jQuery toggle state
body: <p>I am using the <code>toggle()</code> method on buttons so that they can have a <code>do something</code> / <code>revert changes</code> behaviour. For instance:</p>
  
  <pre><code>$('button').toggle(function() {
    // case 1: maximize
    // ...
    another_function($(this));
    }, function() {
     // case 2: minimize
     // ...
    another_function($(this));
  });
  </code></pre>
  
  <p>In both <code>toggle</code> cases, the same function is called at the end (<code>another_function()</code>). I would like from that function to find out whether we are in <code>case 1</code> or in <code>case 2</code> without having to manipulate the button myself (e.g add a class, set a custom attribute before calling the function, and check on those changes inside the function).</p>
  
  <p><strong>Is there a way to find out from the element state data itself in which toggle case we're in (surely jQuery must set a state somewhere to know which part of the toggle to execute)?</strong></p>
  
  <p>PS: there are many posts related to that topic already on SO but they're about <code>hide/show</code> cases and their suggestions (check if it's visible, hidden...) doesn't apply here.</p>