title: call a function when window resize
body: <p>I have progress bar on my page. It works, but if I resize window I have problem with it's <code>width</code> - it doesn't change.</p>
  
  <p>html:</p>
  
  <pre><code>&lt;h4 class="progress-title"&gt;Title &lt;span class="pull-right"&gt;80%&lt;/span&gt;/h4&gt;
  &lt;div class="progressBar prog-bar1"&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>javascript code</p>
  
  <pre><code>   function progress(percent, $element) {
          var progressBarWidth = percent * $element.width() / 100;
          $element.find('div').animate({ width: progressBarWidth }, 5000).html(percent + "% ");
      }
  
      try {
          progress(80, $('.prog-bar1'));
  
      } catch(err) {
  
      }
  </code></pre>
  
  <p>How can I call function when window is resized?</p>