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!

imageready preload

Status
Not open for further replies.

kerick

IS-IT--Management
Nov 17, 2000
40
US
How do I force all images to preload before the pages shows.


Image ready automatically preloads the rollover effects, so
I've added all my gifs to the preload command and the page loads better but how do I force it to load all of the pictures before it will show the page. I don't want the page to load in many pieces.
 
Hi,

You need to add every single image you use to the Javascript code that ImageReady creates. I forget the syntax off hand but you will list every single image in a list first.

Hope this helps!

NATE


mainframe.gif


Got a question? Search G O O G L E first.
 
I thought I had, I'll double check
 
I had all the gifs in the preload script but it still doesn't all load at the same time. any other tips?
 
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ImageReady Preload Script (Mod5_R.psd) -->
<script type="text/javascript">
<!--

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
kmcmainsearch_05_under = newImage("images/spacer.gif");
kmcmainsearch_05_under = newImage("images/go.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_01.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_02.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_03.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_04.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_05.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_06.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_07.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_08.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_09.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_10.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_11.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_12.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_13.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_14.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_15.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_16.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_17.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_18.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_19.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_20.gif");
kmcmainsearch_05_under = newImage("images/kmcmainsearch_21.gif");
kmcmainsearch_05_over = newImage("images/kmcmainsearch_05-over.gif");
kmcmainsearch_06_over = newImage("images/kmcmainsearch_06-over.gif");
kmcmainsearch_07_over = newImage("images/kmcmainsearch_07-over.gif");
kmcmainsearch_08_over = newImage("images/kmcmainsearch_08-over.gif");
kmcmainsearch_16_over = newImage("images/kmcmainsearch_16-over.gif");
kmcmainsearch_18_over = newImage("images/kmcmainsearch_18-over.gif");
kmcmainsearch_19_over = newImage("images/kmcmainsearch_19-over.gif");
kmcmainsearch_20_over = newImage("images/kmcmainsearch_20-over.gif");
preloadFlag = true;
}
}

// -->
</script>
<!-- End Preload Script -->
</head>


 
Hi,

Sorry I have been busy. Try this out:

Other than using that generator that basic JS code for preloading is this:

<SCRIPT language="JavaScript">
<!--
pic1= new Image(100,25);
pic1.src="//-->
</SCRIPT>

So to do mulptiple ones you would do them in sequence:

pic1= new Image(100,25);
pic1.src="pic2= new Image(100,25);
pic2.src="pic3= new Image(100,25);
pic3.src=" etc

Hope this helps!

NATE


mainframe.gif


Got a question? Search G O O G L E first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top