Created
March 23, 2017 14:35
-
-
Save nickberens360/9531086527078204586f377d7cb99588 to your computer and use it in GitHub Desktop.
Loop through elements with incrementing class name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = 0; | |
$('.picBoxGrid').find('.picBox').each(function () { | |
if (i < 4) { | |
i++; | |
} | |
else { | |
i = 1; | |
} | |
$(this).addClass('picBoxColor-' + i); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment