I have a group of div elements arranged side by side with the float:left style as shown below:
<div id="container">
<div id=0" style="float:left">> Stuff </div>
<div id=1" style="float:left">> Stuff </div>
<div id=2" style="float:left">> Stuff </div>
...
<div id=n" style="float:left">> Stuff </div>
</div>
My goal is to create an effect where clicking on one div will move neighboring divs (those to its left up and those to its right down) and expand to fill its own row. Clicking again would return it to its original position.
Here are my strategies:
- Insert a separating line using jQuery before and after the clicked div
- Toggle the clear: both CSS property for the selected div
Despite trying these methods, I haven't found them to be entirely reliable. If you have any suggestions for achieving this functionality, please share!
Thank you for your assistance!