指定JPG的加载顺序? [英] Specify loading order of JPGs?

查看:85
本文介绍了指定JPG的加载顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法指定图片在网页上加载的顺序

页面?


更具体地说,这就是我们需要的实现:


Image1首先开始加载,浏览器不会继续通过

HTML,直到Image1加载完全。 Image1完成后,Image2 BEGINS

loading。当Image2 100%完成时,图像3才开始......所以

on ...


任何能够提供办法的人这个?某种浏览器暂停命令

是理想的解决方案,它将暂停加载HTML直到

当前命令完成,然后转到HTML的下一个块 。

-

谢谢,




试试Google Quik-e-search?在 www.Superhighstreet.com/home

.. ..找到任何东西或他们为你买它!

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.
--
Thanks,
Me

Try Google Quik-e-search? at www.Superhighstreet.com/home
....Finds anything or they buy it for you!

推荐答案

通过设置一些默认的浏览器行为无法做到这一点。


每个图像标签都有一个onload处理程序。您可以使用它开始加载

下一张图片。例如:


< 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);">


其他地方:


< script type =" text / javascript" >


var srcs = {

img1:''one.jpg'',

img2:''两个。 jpg'',

img3:''three.jpg''

}


函数加载(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>


这样的事情


Vincent


Chris Tomlinson写道:
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:

有没有办法指定图像加载到网上的顺序

页面?


更具体地说,这是我们需要实现的目标:


Image1开始加载fi rst,浏览器不会继续通过

HTML,直到Image1加载完全。 Image1完成后,Image2 BEGINS

loading。当Image2 100%完成时,图像3才开始......所以

on ...


任何能够提供办法的人这个?某种浏览器暂停命令

是理想的解决方案,它将暂停加载HTML直到

当前命令完成,然后转到HTML的下一个块 。
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.


" Chris Tomlinson" < an ** @ anon.comwrote in message

news:G4 ****************** @ text.news.blueyonder.co。英国...
"Chris Tomlinson" <an**@anon.comwrote in message
news:G4******************@text.news.blueyonder.co. uk...

您好,有没有办法指定图片在网页上加载的顺序

页面?


更具体地说,这是我们需要实现的目标:


Image1首先开始加载,浏览器不会继续通过

HTML直到Image1加载完全。当Image1完成后,Image2

BEGINS加载。当Image2 100%完成时,图像3才开始......

等......


任何能够提供办法的人这个?某种类型的浏览器暂停

命令是理想的解决方案,它会暂停加载HTML直到

当前命令已完成,然后转到

HTML的下一个块。
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.



我一会儿实验,看看
http://www.cryer.co.uk/resources/javascript/script3.htm


最重要的是你可以做到,但你必须使用JavaScript。我的

建议不会去那条路线,除非你有充分的理由

吧。

-

Brian Cryer
www.cryer.co.uk/brian

I experimented with this a while back, take a look at
http://www.cryer.co.uk/resources/javascript/script3.htm.

The bottom line is that you can do it, but you have to use JavaScript. My
advice would be not to go that route unless you have a very good reason for
it.
--
Brian Cryer
www.cryer.co.uk/brian


感谢文森特,我们将对此进行调查。


" Vincent van Beveren" < vv ********* @ xiam.nlwrote in message

news:44 ********************* **@news.kpnplanet.nl ..
Thanks Vincent, we will look into this.

"Vincent van Beveren" <vv*********@xiam.nlwrote in message
news:44***********************@news.kpnplanet.nl.. .

通过设置一些默认浏览器行为无法做到这一点。


每个图像标签都有一个onload处理程序。您可以使用它开始加载

下一张图片。例如:


< 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);">


其他地方:


< script type =" text / javascript" >


var srcs = {

img1:''one.jpg'',

img2:''两个。 jpg'',

img3:''three.jpg''

}


函数加载(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>


这样的事情


Vincent


Chris Tomlinson写道:
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:

>有没有办法指定加载图像的顺序一个
网页?

更具体地说,这是我们需要实现的目标:

Image1首先开始加载,浏览器不会通过
HTML直到Image1加载完全。 Image1完成后,Image2
BEGINS加载。当Image2 100%完成时,图像3才开始......依此类推......

任何人都能提供这样做的方法吗?某种类型的浏览器Pause
命令是理想的解决方案,它会暂停加载HTML
直到当前命令完成,然后转移到下一个
''块''的HTML。
>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.



这篇关于指定JPG的加载顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆