I work with some markup, where we have several html blocks / elements located inside an external container, this container is the main line with the maximum width.
In some situations, I need blocks to break out of this container, go beyond the maximum width and occupy the full width, but remain in its original position in terms of the index. Stay with me! It looks like this:
<div class="row"> <div><em>Regular block here</em></div> <div class="full-width"><em>Full width block here</em></div> <div><em>Regular block here</em></div> </div>
Essentially, I want to have the following:
<div class="row"> <div><em>Regular block here</em></div> </div> <div class="full-width"><em>Full width block here</em></div> <div class="row"> <div><em>Regular block here</em></div> </div>
Unfortunately, we do not have access to do this correctly in html, so jQuery looks its best.
I tried to do something like this, but to no avail, as it did not format html correctly:
$('div.row > .full-width').each(function() { $(this).before('</div>').after('<div>'); });
Someone has an idea to achieve this without writing the entire DOM completely, otherwise I will have to reload the bindings.
Thanks in advance.
javascript jquery html css
user1408133
source share