Solved

page loading in correct order

Posted on 2001-06-19
7
160 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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