Do stuff if next NOT hasClass?

Well yeah probably.

Basically Its a flow of divs with either medium-6 or medium-12 classes to set the width of them. Medium-6 is 50% width and medium-12 is 100% width.

And the reason I am trying to do this is to remove “holes” from the layout. If the layouts is like:

<div class="medium-6"></div>
<div class="medium-6"></div>
<div class="medium-12"></div>
<div class="medium-6"></div>
<div class="medium-6"></div>

everything is fine, no holes. But if the layout turns out like this:

<div class="medium-6"></div>
<div class="medium-6"></div>
<div class="medium-6"></div> <!-- hole after this one -->
<div class="medium-12"></div>
<div class="medium-6"></div> <!-- hole after this one -->
<div class="medium-12"></div>

We can see there is one standalone medium-6 in there, which creates a hole equal to the width of a medium-6 next to it. It is in this situation I want that medium-6 to occpy the whole width instead, by changing its class to medium-12.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.