Scriptin Trouble lol

They have: 2 posts

Joined: Aug 2004

Hi guys,

I'm in desperate need of a script to do the following, just wondering if anybody had any ideas or could point me in the right direction. As I'm a novice, rather than saying what a script needs to do, could anybody possibly paste the script in? Thanks in advance...

Ive got a page with no text, but with 40+ small images... I've reduced the quality as much as possible, and although it only takes bout 2-3 seconds to load the page, it looks soooooo untidy with them all opening at different times... If it is possible, I'd love a script which would delay loading of the images, and then display them all at once.

If this is possible, is there a script to do it?

Thanks in advance,
Mark

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

What about a preloading script?

<script type="text/javascript">
<!--
var image1 = new Image();
image1.src = "images/image1.gif";
var image2 = new Image();
image2.src = "images/image2.gif";
//-->
&lt;/script&gt;
'

The above code goes in the tag and just repeat the blocks for as many images as you have.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

This is where you ask yourself if you, as the designer, are responsible for the way the client or server technology handles these things. You do everything you can within reason to make the page perform well and look good -- but that is the page itself, not the HTTP interaction. Really, I don't think you should bother about how the page loads, as long as you haven't done something utterly absurd to cause unpleasantness.

Is it a real concern to your users how the page loads? Most surfers are used to this sort of thing and don't even notice it.

Additionally, using what Renegade suggests will not guarantee anything. It is only a technique to try to preload images, and, afaik, is only useful for images that are to be loaded upon some other event, such as in a rollover. The images may still load in a disorganised way. In this case, if anythinng, it will only ensure that the filesize and download time grow.

Smiling

Busy's picture

He has: 6,151 posts

Joined: May 2001

Also remember to use the width and height tags on ALL images, will stop the jumping of the page as it loads (also speeds up load time among other things)

They have: 2 posts

Joined: Aug 2004

Hi guys,

Thanks for your opinions, but I really do need that script... if it exists!
http://marsell.co.uk/simplebob/ - ave a look, see what i mean lol

Please dont say 'it looks ok,' or 'no need to change anything' because to me I need to have them all loading at the same time lol Also, the way I've created the site means I need to have all those images, rather than cut down, merging etc. etc.

Any ideas for a script? Or should I look elsewhere? Thanks for any help...

All the best,
Mark

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

It loads all at the same time on Firefox 0.9.1.

I still think it's unnecessary. Really. It's up to you.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.