This question has been answered by benmarte. See the first response.

div::nth-child(5n)
$('div:nth-child(5n)').addClass('className');
<script type="text/javascript">
$(window).load(function(){
$('div.album:nth-child(5n)').addClass('no-margin');
});
</script>

<script type="text/javascript">
$(document).ready(function(){
$('div.album:nth-child(5n)').addClass('no-margin');
});
</script>



.album{float:left; width:180px; height:138px; margin:0 20px 20px 0; background-color:#ccc; }
.no-margin{margin-right:0;} <script type="text/javascript">
$(document).ready(function(){
$('.album:nth-child(5n)').addClass('no-margin');
});
</script>
