Created
November 23, 2012 17:39
-
-
Save seb-thomas/4136604 to your computer and use it in GitHub Desktop.
Arguments
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
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