Change height of second portlet whenever the first portlet is toggled

Change height of second portlet whenever the first portlet is toggled

Hi,

Please kindly advise, I want the second portlet to change height to be the same as the first portlet whenever I did a toggle on the first portlet.

I used the standard jquery ui portlet, the code below is what I have tried but nothing happens when I toggle the first portlet...

Script:
  1.     $( ".portlet-toggle" ).click(function() {
  2.       var icon = $( this );
  3.       icon.toggleClass( "ui-icon-minusthick ui-icon-plusthick" );
  4.       icon.closest( ".portlet" ).find( ".portlet-content" ).toggle();
  5.       var a = $("#also");
  6.  a.height(icon.height());
  7. });
HTML:

  1. <tr><td>
  2.   <div id="also" class="portlet"> Sunday:
  3.   </div></td></tr>

  4. <div class="column">
  5.   <div id="test" class="portlet">
  6.     <div class="portlet-header">Feeds</div>
  7.     <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
  8.   </div>
Because the portlets are side by side, I want #also to expand to same height when #test is opened and minimized to same height when #test is collapsed...

What went wrong with my code?