When you arrive at the current month’s page, javascript in the source code highlights the row that represents today. How can I get the page to scroll down to that row automatically? Page is http://www.itsmyturnnow.com/HWC/BRP/08.htm and script I was given is in source code. Thanks.
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
}
}
}
Use JQuery in the function which hilights the current psalm:
JSFiddle: http://jsfiddle.net/QT3v5/22/