Skip to content

Instantly share code, notes, and snippets.

@martisj
Created January 18, 2013 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martisj/4561951 to your computer and use it in GitHub Desktop.
Save martisj/4561951 to your computer and use it in GitHub Desktop.
class to 3rd and higher than 7th elem
$class = '';
if (($i + 1) % 3 == 0)
{
$class .= 'nth-child-3n';
}
elseif (($i + 1) > 6)
{
$class .= ' nth-child-nplus7';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment