当您到达当月的页面时,源代码中的 javascript 会突出显示代表今天的行。如何让页面自动向下滚动到该行?页面是http://www.itsmyturnnow.com/HWC/BRP/08.htm,我得到的脚本是源代码。谢谢。
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 Gold
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 - gold
}
}
}