title: Removing the $(window).resize Event in jQuery
body: <p>Part of the page I'm developing requires a $(window).resize event to be added to a div when a user clicks a button, in order to toggle between resizing it with the window and leaving it fixed at its original size:</p>
  
  <pre><code>function startResize() {
      $(window).resize(function() {
          $("#content").width(newWidth);
          $("#content").height(newHeight);
      });
  }
  </code></pre>
  
  <p>What I can't work out is how to "turn off" this event when the button is clicked again, so that the content stops resizing. </p>
  
  <pre><code>function endResize() {
      // Code to end $(window).resize function
      $("#content").width(originalWidth);
      $("#content").height(originalHeight);
  }
  </code></pre>
  
  <p>Any help with this would be greatly appreciated.</p>