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:
- $( ".portlet-toggle" ).click(function() {
- var icon = $( this );
- icon.toggleClass( "ui-icon-minusthick ui-icon-plusthick" );
- icon.closest( ".portlet" ).find( ".portlet-content" ).toggle();
- var a = $("#also");
- a.height(icon.height());
- });
HTML:
- <tr><td>
- <div id="also" class="portlet"> Sunday:
- </div></td></tr>
-
- <div class="column">
- <div id="test" class="portlet">
- <div class="portlet-header">Feeds</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
- </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?