Skip to content

Instantly share code, notes, and snippets.

@DrLulz
Last active July 2, 2016 12:47
Show Gist options
  • Select an option

  • Save DrLulz/0d9fdefca9cb0bc722fecb67dcc0afa2 to your computer and use it in GitHub Desktop.

Select an option

Save DrLulz/0d9fdefca9cb0bc722fecb67dcc0afa2 to your computer and use it in GitHub Desktop.
// http://stackoverflow.com/questions/967815/how-do-you-fade-in-out-a-background-color-using-jquery
//Color row background in HSL space (easier to manipulate fading)
$('tr').eq(1).css('backgroundColor','hsl(0,100%,50%');
var d = 1000;
for(var i=50; i<=100; i=i+0.1){ //i represents the lightness
d += 10;
(function(ii,dd){
setTimeout(function(){
$('tr').eq(1).css('backgroundColor','hsl(0,100%,'+ii+'%)');
}, dd);
})(i,d);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment