My setup is quite intricate.
I have a layout with 2 rows consisting of three divs each on larger screens.
It looks something like this:
<div class="row row-1">
<div class""square">square 1</div>
<div class""square">square 2</div>
<div class""square">square 3</div>
</div>
//some more html
<div class="row row-2">
<div class""square">square 4</div>
<div class""square">square 5</div>
<div class""square">square 6</div>
</div>
On mobile devices, I need to rearrange the squares so that the first two squares from each row are in the top row, and the last square from each row is in the bottom row. It should look like this:
<div class="row row-1">
<div class""square">square 1</div>
<div class""square">square 2</div>
<div class""square">square 4</div>
<div class""square">square 5</div>
</div>
//some more html
<div class="row row-2">
<div class""square">square 3</div>
<div class""square">square 6</div>
</div>
What would be the most efficient way to achieve this? I'm considering using jQuery to detect screen size and move the squares accordingly, but I'm open to other suggestions.
Appreciate any help!