Pushing a nested div underneath its ancestor for mobile
Is there a jQuery way to move a nested div underneath its great grandparent for mobile view. Here's what I've started:
https://codepen.io/Codewalker/pen/aaPRrz
One thought is to create this twice, hiding one and showing the other, depending on the device/width.
- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet">
- <div class="container" style="background:#ddd">
- <div class="num-container">
- <div class="num-thumb">
- <img src="https://dummyimage.com/71x389/000000/fff&text=Side" class="img-responsive imgNum">
- </div>
- <div class="num-content" style="background:#ddd">
- <h2 class="num-title">Grandparent goes right here</h2>
- <p>This along with that image off to the left is the grandparent div. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. </p>
- <div class="row">
- <div class="col-sm-5">
- <h5>Content col-sm-5</h5>
- <p>Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. </p>
- </div>
- <div class="col-sm-7" style="background:orange">
- <div class="vid-container">
- <div class="vid-thumb">
- <img src="https://dummyimage.com/17x158/000000/fff" />
- </div>
- <div class="vid-content">
- <h5>Content col-sm-7</h5>
- <p>For mobile devices, this orange div needs to wrap underneath the entire gray div. For mobile devices, this needs to wrap underneath the entire gray div.For mobile devices, this needs to wrap underneath the entire gray div.For mobile devices, this needs to wrap underneath the entire gray div.For mobile devices, this needs to wrap underneath the entire gray div. </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>