Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Order

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
Is there a way to tell a page to load something (say like an image or a .swf) last?
 
I don't think so but in case of an image, you can hide it by setting it's style to "display:none" and then show it after a certain time (see faq215-2670 for timer issues) set back its visibility by "display:block" Water is not bad as long as it stays out human body ;-)
 
Because a pages onload event does not fire until all other parts in the page have loaded you could set you IMG tag not to have SRC and then set the source on load. There is a problem with Netscape that mean that you would have to specific the size of the image you want to appear (otherwise it would be shrunk):

<HTML>
<SCRIPT>
function postLoad() {
var image = document.all.LoadLater;
image.src=&quot;Img1.jpg&quot;;
}
</SCRIPT>
<BODY onload=&quot;alert('Document Loaded');test()&quot; >
<IMG name=&quot;LoadLater&quot; height=200 width=100>
</BODY>
</HTML>

Hope this helps,

Kev
[afro2]
 
Ooopss...sorry test script.... here is the real one:

<HTML>
<SCRIPT>
function postLoad() {
if (document.all)
myImage = this.LoadLater;
else
myImage = document.LoadLater;
myImage.src=&quot;Img1.jpg&quot;;
}
</SCRIPT>
<BODY onload=&quot;alert('Document Loaded');postLoad()&quot; >
<IMG name=&quot;LoadLater&quot; border=0 width=100 height=5>
</BODY>
</HTML>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top