title: jQuery .on() combined with Modernizr.prefixed()
body: <p>I just try to understand a jQuery-Script which I must use.<br>
  Now I found the following snip:</p>
  
  <pre><code>$currPage.addClass( outClass ).on( animEndEventName, function() {
      $currPage.off( animEndEventName );
      endCurrPage = true;
      if( endNextPage ) {
          onEndAnimation( $currPage, $nextPage );
      }
  });
  </code></pre>
  
  <p>Explenation what I already know:<br>
  <code>$currPage</code>: This is the current page. It's a <code>&lt;div class="page"&gt;</code><br>
  <code>endCurrPage</code>: This is a boolean which is in standard false<br>
  <code>endNextPage</code>: Is similar to the <code>endCurrPage</code>  </p>
  
  <p>My question is the <code>.on( animEndEventName,</code> part. The <code>animEndEventName</code> variable looks like that:</p>
  
  <pre><code>var animEndEventNames = {
      'WebkitAnimation' : 'webkitAnimationEnd',
      'OAnimation' : 'oAnimationEnd',
      'msAnimation' : 'MSAnimationEnd',
      'animation' : 'animationend'
  },
  animEndEventName = animEndEventNames[ Modernizr.prefixed( 'animation' ) ];
  </code></pre>
  
  <p>This code is by Modernizr.prefixed(): <a href="http://modernizr.com/docs/#prefixed" rel="nofollow">http://modernizr.com/docs/#prefixed</a></p>
  
  <p>jQuery's <code>.on()</code> wait for an event, here <code>animEndEventName</code>. So how this actually works? I don't understand exactly this part...</p>
  
  <p>I hope You can help me. If you need more code, just say it. But I think this is the relevant part.</p>