ElEditors, Interface administrators, Administrators
85,546
edits
mNo edit summary |
mNo edit summary |
||
Line 272: | Line 272: | ||
/****************************** Common Gradient ******************************/ | /****************************** Common Gradient ******************************/ | ||
$(function() { | $(function(){ | ||
/* Deal with non-transparent headers */ | |||
var | var grad_transparent = $(document.createElement('span')).css('background-color'); /* Transparent Calculated Color*/ | ||
$('tr:not(:has(td))').not('.rainbow').css('background-image', function(){ | |||
var grad_color = $(this).css('background-color'); | |||
if(grad_transparent != grad_color){ /* If bgcolor is not transparent */ | |||
$(this).css('background-image', ['linear-gradient(to bottom', '#eee', grad_color + ')'].join(',')); | |||
var | |||
if ( | |||
$(this).css('background-image', 'linear-gradient(to bottom, #eee, | |||
} | } | ||
}); | }); | ||
/* Deal with rainbow rows */ | |||
$('tr.rainbow').each(function(){ | |||
var rb_totalWidth = parseInt($(this).outerWidth(true)); | |||
var rb_cStart, rb_cEnd, rb_sumWidth = 0; | |||
$(this).children('td, th').each(function(){ | |||
rb_cStart = ['hsl(' + parseFloat(rb_sumWidth / rb_totalWidth * 360).toString(), '100%', '75%)'].join(','); | |||
rb_sumWidth += $(this).outerWidth(true); | |||
rb_cEnd = ['hsl(' + parseFloat(rb_sumWidth / rb_totalWidth * 360).toString(), '100%', '75%)'].join(','); | |||
$(this).css({ | |||
'background-image': ['linear-gradient(to right', rb_cStart, rb_cEnd + ')'].join(',') | |||
}); | |||
}); | |||
}); | }); | ||
/* | /* |