ElEditors, Interface administrators, Administrators
85,546
edits
mNo edit summary |
mNo edit summary |
||
Line 305: | Line 305: | ||
} | } | ||
}); | }); | ||
/* Deal with rainbow rows */ | /* Deal with rainbow rows */ | ||
$('.rainbow').each(function(){ | $('.rainbow').each(function(){ | ||
var rb_TotalWidth = parseInt($(this).width()) | var rb_TotalWidth = parseInt($(this).width()), | ||
rb_LBorder = 0, | |||
var | rb_RBorder, | ||
var rb_HSL | rb_CellWidth; | ||
rb_Element = | var rb_LPos, | ||
rb_RPos, | |||
rb_LCheckpoint, | |||
rb_RCheckpoint; | |||
var rb_HSL; | |||
var rb_Element = $(this).children().length ? $(this).children() : $(this); | |||
rb_Element.each(function(){ | rb_Element.each(function(){ | ||
rb_CellWidth = $(this).outerWidth(true); | |||
rb_CellWidth = | |||
rb_RBorder = rb_LBorder + rb_CellWidth; | rb_RBorder = rb_LBorder + rb_CellWidth; | ||
rb_LPos = rb_LBorder / rb_TotalWidth * 10; | |||
rb_RPos = rb_RBorder / rb_TotalWidth * 10; | |||
rb_HSL.push('hsl(' + ( | rb_LCheckpoint = Math.ceil(rb_LPos); | ||
rb_RCheckpoint = Math.floor(rb_RPos); | |||
rb_HSL = ['hsl(' + (rb_LPos * 36).toString() + ',100%,50%) 0%']; | |||
for(var i = rb_LCheckpoint; i <= rb_RCheckpoint; i++){ | |||
rb_HSL.push('hsl(' + (i * 36).toString() + ',100%,50%) ' + ((i - rb_LPos) * 10).toString() + '%'); | |||
} | } | ||
rb_HSL.push('hsl(' + ( | rb_HSL.push('hsl(' + (rb_RPos * 36).toString() + ',100%,50%) 100%'); | ||
rb_LBorder = rb_RBorder; | |||
$(this).css({ | $(this).css({ | ||
'background-image': 'linear-gradient(to right,' + rb_HSL.join(',') + ')' | 'background-image': 'linear-gradient(to right,' + rb_HSL.join(',') + ')' | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
/* | /* | ||
$('table.odd-stripe > tbody > tr:has(td):').css('background-color', function(){ | $('table.odd-stripe > tbody > tr:has(td):').css('background-color', function(){ |