I have a bit fo code which is working fine, it either doesn't add a class or ads a classe of wide
to items within a list.
I am trying to find a solution to limit how many of the list items can have the class of wide.
I am using this more a masonry wall and would like to limit the number of wide items within the wall.
My current code is below, is there a way to limit this?
// Random masonry item class on homepage
jQuery(document).ready(function(){
var classes = [" ", "wide"];
jQuery(".mix-target").each(function(){
jQuery(this).addClass(classes[~~(Math.random()*classes.length)]);
});
});