ok, I've tried the javascript sample in my code as follows. After my first section I have an asp:button control on which I add OnClientClick="movecursor();".
My movecursor function and the function it calls are as follows: (note that "divMortPct" is the id of the div where I want the screen to scroll down to)
function movecursor()
{
alert("in movecursor");
//Get object
var SupportDiv = document.getElementById('divMortPct');
//Scroll to location of SupportDiv on load
window.scroll(0,findPos(SupportDiv));
}
//Finds y value of given object
function findPos(obj) {
var curtop = 0;
if (obj.offsetParent) {
do {
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return [curtop];
}
}
When I click the button, movecursor starts to execute but in the 3ird line of function findPos (underlined) I get an "object required" error.
I'm hoping someone can advise me on what I'm doing wrong. Thanks.