Hi
I'm trying to make a pattern in a layout (see attachment for visualisation) The problem is that using :odd :even doesnt work.
I've tried to make it work by using "for loops", and if statements, but obviously jquery doesn't do this stuff in that way. Or maybe i'm supposed to do it outside the document ready statement? I tired that to but it just doesnt work.
How does one go about that?
EDIT: Important note... These squares are max 8 on a page and generated in Wordpress, each square being a post. So I'm not able to divide things into rows as suggested unfortunately.
css:
.thumb_container {
width:274px;
height: 274px;
float: left;
position: relative;
background-color: white;
}
.thumb_container:nth-child(4n+1) { clear:both; background-color: green } /* green just to see if its working */
Jquery tweek file (http://baked-beans.tv/bb/wp-content/themes/bakedbeans/js/jquery.site.tweeks.js)
$(".thumb_container:nth-child(8n+2), .thumb_container:nth-child(8n+4), .thumb_container:nth-child(8n+5), .thumb_container:nth-child(8n+7)")
.css({"background-color":"#333333"});
HTML Click HTML for link