Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

page loading in correct order

Posted on 2001-06-19
7
Medium Priority
?
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

 
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 200 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

596 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