在脚本中动态更改字体颜色

时间:2012-08-26 03:57:35

标签: fonts

如何更改结果行中链接文本的字体颜色?未链接的文本从黑色变为白色,但突出显示的行中的链接文本保持黑色。也需要它变白。

var INTENDED_MONTH = 7 //August
// INTENDED_MONTH is zero-relative
now = new Date().getDate(),
rows = document.getElementById('scripture').rows;
if (new Date().getMonth() != INTENDED_MONTH) {
    // need a value here less than 1, or the box for the first of the month will be in Red
    now = 0.5
};
for (var i = 0, rl = rows.length; i < rl; i++) {
    var cells = rows[i].childNodes;
    for (j = 0, cl = cells.length; j < cl; j++) {
        if (cells[j].nodeName == 'TD'
  && cells[j].firstChild.nodeValue != ''
  && cells[j].firstChild.nodeValue == now) {
            rows[i].style.backgroundColor = 'red' // 'ffff99' // '#ffd700' // TODAY - red
            rows[i].style.color = 'white'
      $('html,body').delay(500).animate({scrollTop:rows[i].offsetTop}, 2000);
        }
    }
}​

0 个答案:

没有答案
相关问题