How to change HTML markup structure using javascript or CSS? -
i have following markup in page.
<div class="tm_left"> <!-- left side bar code--> </div> <div class="tm_center"> <!-- content code--> </div> <div class="tm_right"> <!-- right side bar code--> </div>
is possible change markup following when page opened on 768px width , below :
<div class="tm_center"> <!-- content code--> </div> <div class="tm_left"> <!-- left side bar code--> </div> <div class="tm_right"> <!-- right side bar code--> </div>
i not want touch <div class="tm_center"><!-- content code--></div>
want moving <div class="tm_left"><!-- left side bar code--></div>
between other 2 divs when page opened in 768px width , below.
can achieve using java script / css? if java script solution work on mobiles?
kindly try best before asking these questions! ans below!
$(window).resize(function(){ if(window.innerwidth < 768) { var $detcenter = $(".tm_center").detach(); $(".tm_left").before($detcenter); } });
Comments
Post a Comment