I have progress bar on my page. It works, but if I resize window I have problem with it's `width` - it doesn't change.

html:

```
<h4 class="progress-title">Title <span class="pull-right">80%</span>/h4>
<div class="progressBar prog-bar1"><div></div></div>

```

javascript 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) {

    }

```

How can I call function when window is resized?