简单的!
你所需要的只是一个线性渐变 CSS 规则。
$(function() {
$( "#tabs" ).tabs();
$('.gradient_me').each( function(index) {
var color = 'rgb(' + (255-index*75) + ', 0, 0)';
var color2 = 'rgb(' + (255-index*75 - 75) + ', 0, 0)';
$(this).css('background', '-moz-linear-gradient(left, '+color+', ' + color2 +')');
$(this).css('background', '-webkit-linear-gradient(left, '+color+', ' + color2 +')');
$(this).css('background', '-ms-linear-gradient(left, '+color+', ' + color2 +')');
$(this).css('background', '-o-linear-gradient(left, '+color+', ' + color2 +')');
$(this).css('background', 'linear-gradient(left, '+color+', ' + color2 +')');
});
});
演示:http: //jsfiddle.net/5zfyU/8/