title: jQuery randomly add class to list items with limit
body: <p>I have a bit fo code which is working fine, it either doesn't add a class or ads a classe of <code>wide</code> to items within a list.</p>
  
  <p>I am trying to find a solution to limit how many of the list items can have the class of wide.</p>
  
  <p>I am using this more a masonry wall and would like to limit the number of wide items within the wall.</p>
  
  <p>My current code is below, is there a way to limit this?</p>
  
  <pre><code>// 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)]);
      });
  });
  </code></pre>