Hello,
I have the following scenario:
+-----------------------------------------+
|``````````````Main Div````````````````|
|+-------------------+-------------------+|
||````little div 1```` |````little div 2`````||
||`````````````````| ```````````````` ||
||`````````````````| ```````````````` ||
|+-------------------+-------------------+|
+------------------------------------------+
I have this script call in my jQuery:
Code:
$("#littlediv1").click($("#littlediv2").toggle())
Which automatically will either hide or unhide "little div 2" when "little div 1" is clicked.
Which turns my screen into this:
+-----------------------------------------+
|``````````````Main Div````````````````|
|+-------------------+``````````````````|
||````little div 1```` |``````````````````|
||`````````````````| ```````````````` `|
||`````````````````| ```````````````` `|
|+-------------------+``````````````````|
+------------------------------------------+
I do not know the size of "little div 1" because of variable data. But is there a way to make "Main Div" automatically collapse when this data is hidden so that it would look like this?
+---------------------+
|``````Main Div``````|
|+-------------------+|
||````little div 1```` ||
||`````````````````||
||`````````````````||
|+-------------------+|
+---------------------+
Also it would re-expand when "little div 1" is clicked again.
Is there a jQuery collapse div or a css collapse attribute I can use for this?