pavinder
03-20-2005, 08:11 AM
Hi,
I am using the following code in a page within a frameset. The frame id is "imagepage".
I want to scroll to a fixed position on loading, and because there are a number of large images loading, i figured I'd need to check the load status before attempting the scroll command.
I'm using the code as follows, but the scroll is not happening.
I also tried the last line using "parent.imageframe.window.scrollTo" but still no effect. I put an alert between the setInterval and the scrollTo statements, and the alert comes up even though I can still see the page loading indicator running.
Any help gratefully appreciated.
--------------------
in the <HEAD>:
function checkloaded()
{
alldone = document.images.length;
temp = new Array(0);
for (var i=0;i<alldone;i++)
{
if (document.images[i].complete)
{
temp[temp.length] = i
}
}
if (temp.length == alldone) {clearInterval(waitcheckloaded);}
}
and in the <BODY>:
a number of images are loaded in DIV statements for example
<div class="divstylev" id="layer01"><img src="i01.jpg" height="32767" width="32767"></div>
and after that I have the statements
waitcheckloaded = setInterval("checkloaded()", 10);
window.scrollTo(15000, 15000);
------------------------
I am using the following code in a page within a frameset. The frame id is "imagepage".
I want to scroll to a fixed position on loading, and because there are a number of large images loading, i figured I'd need to check the load status before attempting the scroll command.
I'm using the code as follows, but the scroll is not happening.
I also tried the last line using "parent.imageframe.window.scrollTo" but still no effect. I put an alert between the setInterval and the scrollTo statements, and the alert comes up even though I can still see the page loading indicator running.
Any help gratefully appreciated.
--------------------
in the <HEAD>:
function checkloaded()
{
alldone = document.images.length;
temp = new Array(0);
for (var i=0;i<alldone;i++)
{
if (document.images[i].complete)
{
temp[temp.length] = i
}
}
if (temp.length == alldone) {clearInterval(waitcheckloaded);}
}
and in the <BODY>:
a number of images are loaded in DIV statements for example
<div class="divstylev" id="layer01"><img src="i01.jpg" height="32767" width="32767"></div>
and after that I have the statements
waitcheckloaded = setInterval("checkloaded()", 10);
window.scrollTo(15000, 15000);
------------------------