Skip to content

Instantly share code, notes, and snippets.

@jgv
Created March 19, 2012 20:07
Show Gist options
  • Save jgv/2126275 to your computer and use it in GitHub Desktop.
Save jgv/2126275 to your computer and use it in GitHub Desktop.
random color on hover
$(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');
});
});
@jgv
Copy link
Author

jgv commented Mar 19, 2012

"orangle"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment