jbutko
8/26/2013 - 5:12 PM

jQuery, WP: Add class to every 3rd Xth element

jQuery, WP: Add class to every 3rd Xth element

var i = 1;
$('#row .fourcol').each(function() {
    if(i++ % 4 == 0) 
        $(this).addClass('last'); 
});