<div class="first"></div>
<div class="second"></div>
I've tried doing this with CSS changing them from float:left
& float:right
and reversing it under a @media (max-width:820px)
query which I'm sure has worked in the past but didn't work.
Tried a simple JQuery:
if ($(window).width() < 820) {
$( ".first" ).insertAfter( $( ".second" ) );
}
else {
$( ".first" ).insertBefore( $( ".second" ) );
}
I know this should be so simple but it's just not playing ball, what am I doing wrong?