Created
March 19, 2012 20:07
-
-
Save jgv/2126275 to your computer and use it in GitHub Desktop.
random color on hover
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(){ | |
$('#el').hover(function(){ | |
var colors = ['blue', 'green', 'yellow', 'orangle', 'purple', 'gray', 'cyan']; | |
var color = colors[Math.floor(Math.random() * colors.length)]; | |
$(this).css('background', color); | |
}, function(){ | |
$(this).css('background', 'transparent'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"orangle"