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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling the Download Sequence of Images

Status
Not open for further replies.

iconkid

Technical User
Jan 10, 2005
4
US
Will someone please show me how to append the lines in this "sequencial picture loading" script.
Within the dotted lines is a complete script for preloading five pictures. The line for the first image is appended with an improvised "onLoad" event for illustration. Below that are some snippets of code I found but I don't know how to properly construct the lines to halt the execution of the script until each picture is fully loaded. This will work in Internet Explorer -- not in Netscape. The concept is pretty simple. As the page begins to load, the first picture in the list is called for, but since this is coupled with an onLoad event, one that must give a positive return value before proceeding to the next line, no other pictures will be sent down the wire until picture #1 has completely loaded; as each line for an image will be appended, except for the last one, the rest of the pictures follow this sequence, one by one. I just need someone to show me the proper form and syntax to use so that the script is halted if the onLoad (or the the complete download of a given picture ends up being negative or 'false') and to "proceed" with the script if the Onload for a given picture ends up being "true."

-----------------------------------------
<script language=javascript>
function loadImages {

document.firstImage.src = "LIC-1.jpg"; onLoad="returnValue();return false;">
document.secondImage.src = "LIC-2.jpg";
document.thirdImage.src = "LIC-3.jpg";
document.fourthImage.src = "LIC-4.jpg";
document.fifthImage.src = "LIC-5.gif";
}
</script>
-----------------------------------------

onClick="returnValue();return false;">

function someFunction()
{ if (something)
{proceed=true}
else {proceed=false}
return proceed
}
 
This thread can be ended now because I found a script that does exactly what I want it to do, (to have images appear on your web page in the order you specify), it's free and it works in both IE and Netscape.
This is the link:


I must say thanks to Easywebdev for his help and insight.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top