Skip to content

Instantly share code, notes, and snippets.

@seb-thomas
Created November 23, 2012 17:39
Show Gist options
  • Save seb-thomas/4136604 to your computer and use it in GitHub Desktop.
Save seb-thomas/4136604 to your computer and use it in GitHub Desktop.
Arguments
function changeSeasons() {
updateSeason('#spring', 'gray', 'Winter');
updateSeason('#summer', 'orange', 'Autumn');
function updateSeason(sourceSeason, colour, name) {
var element = $(sourceSeason);
var newColour = colour;
var newName = name;
element.css('background-color', newColour);
element.text(newName);
}
}
$('.wrapper').click( function() {
changeSeasons();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment