Last active
August 29, 2015 14:11
-
-
Save gustavom/04fce95a9971b37da05b to your computer and use it in GitHub Desktop.
Simulando nth-child com jquery
This file contains 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
<div class="page-group"> | |
<div class="page"></div> | |
<div class="page"></div> | |
<div class="page"></div> | |
</div> |
This file contains 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
<script> | |
$(document).ready(function(){ | |
var cont = 1; | |
$('.page').each(function(){ | |
if((cont%3)==0){ | |
$(this).css({'margin-right':'0px'}) | |
} | |
cont = cont +1; | |
}); | |
}); | |
</script> |
This file contains 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
.page-group{float:left; width:960px;} | |
.page{float:left; width:306px; height:330px; background:#09C; margin:15px 20px 0 0;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment