Window resized when window is small and remains same even after window width is larger
<p>Sorry for the ambiguous title, wasn't sure what should I use. I want to resize the player (Javascript) on the basis of the window size in an attempt to make it responsive. The standard width is <code>620px</code>, if the width is less than that I want that the width of the components should be <code>100%</code>. I have added a event listener using jQuery. But, the problem is that the player's components width becomes <code>100%</code> when the window size is less than 620, and it remains as 100% even if the window size becomes greater afterwards. Here is my code. </p>

<pre><code>function resizeVideo() {
  var width = $('#slideshow').width();
    if(width &lt; 620) {
      $('#object').width('100%');
      $('#object #background').width('100%');
      $('#object #slide_area').width('100%');
      $('#object #controls').width('100%');
      // alert("here");
    }
    else {

    }
  }
resizeVideo();
window.addEventListener("resize", resizeVideo, false);
</code></pre>
