leonard_770
05-14-2003, 06:01 AM
I have a frameset containing 2 frames;
a top-frame 'menu', that contains button
and a center-frame 'content' that contains
text images etc.
The page size is h:450 w:750
My problem is that when you click a button
I'd like to load another page in then center-frame
but then once it's loaded the page scrolls to an
x co-ordinate of 1500 using the 'scrollit' script below.
Does anyone know how to do this?
Thanks for your help,
Lenny.
function scrollit(dest) {
dx = Math.abs(dest - x) / 30;
if (dx>50) { dx = 50; }
dx2 = 1;
if (dest < x) { dx2 = -1;}
while(dest != x) {
// check arithmetic retardation
if ((dx+1)*(dx+2)/2 <= Math.abs(x-dest)) {
dx = dx + 1;
} else {
if (dx*(dx+1)/2 > Math.abs(x-dest)) {
dx = dx - 1;
}
}
x = x + dx*dx2;
if (dx>50) { dx = 50; }
parent.mid.scrollTo(x, 0);
}
}
a top-frame 'menu', that contains button
and a center-frame 'content' that contains
text images etc.
The page size is h:450 w:750
My problem is that when you click a button
I'd like to load another page in then center-frame
but then once it's loaded the page scrolls to an
x co-ordinate of 1500 using the 'scrollit' script below.
Does anyone know how to do this?
Thanks for your help,
Lenny.
function scrollit(dest) {
dx = Math.abs(dest - x) / 30;
if (dx>50) { dx = 50; }
dx2 = 1;
if (dest < x) { dx2 = -1;}
while(dest != x) {
// check arithmetic retardation
if ((dx+1)*(dx+2)/2 <= Math.abs(x-dest)) {
dx = dx + 1;
} else {
if (dx*(dx+1)/2 > Math.abs(x-dest)) {
dx = dx - 1;
}
}
x = x + dx*dx2;
if (dx>50) { dx = 50; }
parent.mid.scrollTo(x, 0);
}
}