Try.
javascript Code:
var targBox2 = "box2";
function scrollDivToAnchor(a) {
var b = document.getElementById(targBox);
b.scrollTop = document.getElementById(a).offsetTop - b.offsetTop;
var c = document.getElementById(targBox2);
c.scrollTop = document.getElementById(a).offsetTop - c.offsetTop;
// alternately, if your elements are not nested within other nodes inside the box,
// you could use document.getElementById(a).parentNode.scrollTop
// that way you wouldn't need to specify the id of the scrollable box
}
And you might as well take a look at the comment. That could help too.
Quote:
// alternately, if your elements are not nested within other nodes inside the box,
// you could use document.getElementById(a).parentNode.scrollTop
// that way you wouldn't need to specify the id of the scrollable box
|