Solved

page loading in correct order

Posted on 2001-06-19
7
165 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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