function setUpPieces() {
//select all the divs with class 'piece'
//add the 'light' class to half of them
//add the 'dark' to the other half
var $evenCheckerPieces = $('div:even').filter('.piece');
var $oddCheckerPieces = $('div:odd').filter('.piece');
var pieceCount = 12;
for (var i=0;i<pieceCount;i++) {
$evenCheckerPieces.addClass('light');
$oddCheckerPieces.addClass('dark');
}
}
//note: further code exists beyond this line
No comments:
Post a Comment