title: jQuery resize plugin on divs
body: <p>I have been looking at this plug-in <a href="http://benalman.com/code/projects/jquery-resize/examples/resize/" rel="nofollow">http://benalman.com/code/projects/jquery-resize/examples/resize/</a> and can make it work fine with the example for displaying the dimensions of the window.  </p>
  
  <p>I want to display the dimensions of a specific div, when I try to do this the dimensions are displayed when the page loads but do not change as the div is resized by changing the browser window.  </p>
  
  <p><strong>I'm using this code:</strong></p>
  
  <pre><code>// Bind the resize event. When the window size changes, update its corresponding
  // info div.
  $('.main').resize(function(){
      var elem = $(this);
  
      // Update the info div width and height 
      $('#main-dim').text( 'Main, width: ' + elem.width() + ', height: ' + elem.height() );
  });
  
  // Updates the info div immediately.
  $('.main').resize();
  
  });
  </code></pre>
  
  <p><code>.main</code> is the div I want to get the dimensions on, <code>#main-dim</code> is the div to display the dimensions in.  </p>
  
  <p>Can anyone tell me what I am doing wrong here?</p>
  
  <p>Thanks!   </p>