You are here: Re: Specify loading order of JPGs? « HTML « IT news, forums, messages
Re: Specify loading order of JPGs?

Posted by Chris Tomlinson on 07/06/06 14:47

Thanks Vincent, we will look into this.

"Vincent van Beveren" <vvanbeveren@xiam.nl> wrote in message
news:44acd48a$0$13213$9a622dc7@news.kpnplanet.nl...
> There is no way to do this by setting some default browser behavour.
>
> Every image tag has an onload handler. You can use this to start loading
> the next image. For example:
>
> <img id="img1" src="firstImage.jpg" onload="loaded(this.id);">
> <img id="img2" src="empty.gif" onload="loaded(this);">
> <img id="img3" src="empty.gif" onload="loaded(this);">
>
> elsewhere:
>
> <script type="text/javascript">
>
> var srcs = {
> img1 : 'one.jpg',
> img2 : 'two.jpg',
> img3 : 'three.jpg'
> }
>
> function loaded(img) {
> if (img.src.indexOf('empty.gif') {
> return; // ignore empty
> } nextImgId = νmg' + (parseInt(img.id) + 1);
> nextImg = document.getElementById(nextImgId);
> nextImg.src = srcs[nextImgId];
> }
>
> </script>
>
> Somthing like that
>
> Vincent
>
> Chris Tomlinson wrote:
>> Hi, is there any way to specify the sequence in which images load on a
>> web page?
>>
>> More specifically, here is what we need to achieve:
>>
>> Image1 starts loading first and the browser does not continue through the
>> HTML until Image1 has loaded COMPLETELY. When Image1 is done, Image2
>> BEGINS loading. When Image2 is 100% done, only then does Image 3
>> begin... and so on...
>>
>> Anyone able to offer a way to do this? Some sort of browser "Pause"
>> command is the ideal solution, which would pause the loading of HTML
>> until the current command has completed, and THEN move on to the next
>> 'chunk' of HTML.

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация