title: Bind function to window resize and window scroll but also invoke it immediately
body: <p>So, on a web-page there are some components that have to be re-positioned whenever the browser window is re-sized or scrolled. </p>
  
  <pre><code>$( window ).on( 'resize scroll', reposition );
  </code></pre>
  
  <p>where <code>reposition</code> is the function that does that.</p>
  
  <p>However, that function has to be invoked immediately too. (By immediately, I mean on page initialization - inside DOM-ready.) This needs to be done to set up the initial positions of the components. </p>
  
  <p>I'm currently doing it like so:</p>
  
  <pre><code>$( window ).on( 'resize scroll', reposition );
  reposition();
  </code></pre>
  
  <p>I noticed that this also works:</p>
  
  <pre><code>$( window ).on( 'resize scroll load', reposition );
  </code></pre>
  
  <p>I believe this is reliable - the <code>load</code> is never fired before the <code>DOMContentLoaded</code> event. </p>
  
  <p>But this delays the execution until after all page resources have been loaded (which could take a few seconds depending on how many images there are on the page). Is there any way to tell jQuery that the bound function should be invoked immediately too?</p>
  
  <p>Like:</p>
  
  <pre><code>$( window ).on( 'resize scroll now', reposition );
  </code></pre>
  
  <p>or </p>
  
  <pre><code>$( window ).on( 'resize scroll ()', reposition );
  </code></pre>
  
  <p>These examples are of course invalid, but I was wondering if jQuery's <code>on</code> method has such functionality. I guess, I could manually implement this functionality into <code>on</code>, but I'd like to first check if it has that already...</p>