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

Loading..... How to I get this message?

Status
Not open for further replies.

boyfromoz

Technical User
Feb 1, 2001
469
AU
I've built some sites that laod in OK time, but some of the features do nto work fo some time after the page loads. ie I have lots of rollovers, and after the front image arrives, the back iamge arrives some seconds later.

I need a "loading'message but don't know how to do it. My sites are not 'Flash" sites so I can't use a flash movie.

Anyone?
 
<!-- TWO STEPS TO INSTALL PRELOAD IMAGES:

1. Copy the coding into the HEAD of your HTML document
2. You can use the preload script with the &quot;Change Image&quot; script at
-->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

<!-- Begin

image1 = new Image();
image1.src = &quot;image1.gif&quot;;

image2 = new Image();
image2.src = &quot;image2.gif&quot;;

// End -->
</script>

<p><center>
<font face=&quot;arial, helvetica&quot; size=&quot;-2&quot;>Free JavaScripts provided<br>
by <a href=&quot; JavaScript Source</a></font>
</center><p>

<!-- Script Size: 0.54 KB -->
 
for the javascript loading check out a site called as


regards Unicorn11
unicorn11@mailcity.com

[red]Luck is not chance, it's toil; fortune's expensive
smile is earned.[red]
 
Try following steps (you'll have to dig in the source...):

1. Create a layer that holds the image and is showing:

Code:
<div id=&quot;loader&quot; style=&quot;display:none&quot;>
<img ...>
</div>

2. Insert following JavaScript at the beginning end of your image preloading blocks (from above)

Code:
<script language=&quot;JavaScript&quot;>
// check the browser version
var NS4 = (bName == &quot;Netscape&quot; && bVersion >= 4);
var IE4 = (bName == &quot;Microsoft Internet Explorer&quot; && bVersion >= 4);
// show the loader image
if (IE4)
{
  var loader = window.document.all[&quot;loader&quot;];
  loader.style.display = &quot;block&quot;;
}
else if (NS4)
{
  var loader = document[&quot;loader&quot;];
  loader.display = &quot;block&quot;;
}
// ...
// All the stuff from above (preloading) and the one DW created one...
// ...
// hide the loader image
if (IE4)
{
  var loader = window.document.all[&quot;loader&quot;];
  loader.style.display = &quot;none&quot;;
}
else if (NS4)
{
  var loader = document[&quot;loader&quot;];
  loader.display = &quot;none&quot;;
}
</script>

Please note: The image won't appear on any other browser than IE 4 or NS 4 (or higher)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top