Solved

page loading in correct order

Posted on 2001-06-19
7
164 Views
Last Modified: 2010-04-25
Hi Folks,
Please take a look here
http://perso.libertysurf.co.uk/roryjac/epsilon.htm
This is part of a course that i am doing. I cannot get the images to load in the correct order.
As you will see the image that i would like to load first always loads last.
Any help would be appreciated.
thanks
Rorf
0
Comment
Question by:rorf
7 Comments
 
LVL 2

Expert Comment

by:sherly
ID: 6209628
Which image you would like to load first?
0
 

Author Comment

by:rorf
ID: 6211418
Sorry
the image that needs to load first is:
800load.jpg
It always loads last. It was the last image added to the page as instructed by my tutor.
Even he is stumped.
Thanks
Rorf
0
 

Author Comment

by:rorf
ID: 6239431
Please someone help me
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6242970
have you tried preloading it??
0
 
LVL 2

Expert Comment

by:sherly
ID: 6243755
Why not make page to load the 800load.jpg first and then redirect to  another page?
0
 

Accepted Solution

by:
jastroem earned 50 total points
ID: 6244699
I don't think that you can control in which order the images are loaded(?) What you could do is to preload them on a previous page. Even better would be to preload them and have an auto redirect to the page where the images should be displayed when the images have been loaded.

you can use this code for that:

//// Put this Script somewhere between <head> </head>

<script language="javascript">
<!--
function initArray() {
 this.length = initArray.arguments.length;
 for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
 }
}

 var pics = new initArray(
 "images/menueimages/botright.jpg",
 "images/menueimages/center.jpg"

//just fill up with images here that you want to preload - the last one without comma ,


 

function transfer(param) {
  location.href = "index-sub.htm"; // URL of second page goes here **
}
// *************************************************************

function done() {
 if (vers < 1.1)
  transfer();
 else
  commence_loading();
}

function commence_loading() {
 for (g=0;g<pics.length;g++)
  eval('document.preload'+g+'.src = "'+pics[g]+'";');
}

// preload the status bar images
// make yourself two GIF's blue.gif and black.gif
// to use for the success bar
if (vers >= 1.1) {
 blue = new Image();
 blue.src = "blue.gif";
 black = new Image();
 black.src = "black.gif";
}

var loaded = new initArray(0);
for (h=0;h<pics.length;h++)
 loaded[h] = 0;
num_loaded = 0;

function update(num) {
 loaded[num]++;
 if (loaded[num] == 2) {
  if (vers < 1.1)
   document.stats.status.value += "||";
  else
   eval('document.status'+num_loaded+'.src = "blue.gif";');
  num_loaded++;
  if (num_loaded == pics.length)
   transfer();
 }
}
// -->
</script>


/////// Put this code somewhere between <body> and </body>

<script language="JavaScript">
<!--
if (vers < 1.1) {
 document.write('What a pitiful browser you have! Get Netscape 3 or above '
  + 'to see all the great stuff on this site.<br><br><br><br><br><br>');
 for (j=0;j<pics.length;j++) {
  document.write('<img src="'+pics[j]+'" width=1 height=1>');
 }
} else {
 document.write('<table align="center"><tr><td align="center">'
  + '<img src="blue.gif" width=10 height=10>');
 for (k=0;k<pics.length;k++)
  document.write('<img src="black.gif" width=15 height=10 name="status'+k+'">');
 document.write('</td></tr></table><br><br><br><br><br><br><br><br>');
 for (j=0;j<pics.length;j++) {
  document.write('<img src="black.gif" width=1 height=1 '
   + 'onLoad="update('+j+')" name="preload'+j+'">');
 }
}
// -->
</script>

I'm not an javascript expert... but I have used this for a site, and it works just fine. But you must make yourself two small GIF's 10 x 10 pixel large, and currently the way the script looks right now these images should be in the same directory as the page itself.

/ Joergen

0
 

Author Comment

by:rorf
ID: 6260452
Thanks jastroem  for your help.
sorry i took so long to answer, ive been away on holiday.
regards
rory
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now