且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

改变图像

更新时间:2023-02-26 20:08:02

" Wade" < WA ** @ wadesmart.com>在消息中写道

news:11 ********************** @ g43g2000cwa.googlegr oups.com ...
"Wade" <wa**@wadesmart.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
08122005 1505 GMT-5

你好。我正在为当地学校的网页工作(就在学校开学之前)。他们外面雇佣的公司真的搞砸了。
我试图让他们的计算机启动并运行并获得他们的应用程序给他们。

有这个代码翻过来世界历史课的图像。我已经从页面中删除了代码,但页面仍然无法正常运行。

我是一个非常新的JS,虽然我明白我在看什么,但我不
有人可以帮我吗?

韦德
08122005 1505 GMT-5

Hello. I am working on a webpage for the local school (just before
school starts). Their outside hired company really screwed things up.
Im trying to get their computers up and running and gain access to
their apps for them.

There is this code that flips through images for World History class. I
have removed the code from the page but the page still does not
function.

Im so very new to JS that while I understand what Im viewing, I do not
understand why it doesnt work.

Could somebody help me on this?

Wade




[ snip]


让我们简化它 - 很多!


< HTML>

&lt ; HEAD>

< TITLE> CountDown< / TITLE>

< script type =" text / JavaScript">

var pic = [

" 1.jpg",

" 2.jpg",

" 3.jpg"

" 4.jpg"

];

var pix = 0;

var sec = 2;

功能图片(){

document.roll.src = pic [pix];

window.setTimeout(" pictures()",1000 *秒);

(pix< pic.length-1)? pix ++:pix = 0;

}

< / script>

< / HEAD>

&lt ; BODY onLoad =" pictures()">

< img src =" 1.jpg"名称= QUOT;辊&QUOT;边界=&QUOT; 0&QUOT; alt ="">

< / BODY>

< / HTML>



[snip]

Let''s simplify it -- a lot!

<HTML>
<HEAD>
<TITLE>CountDown</TITLE>
<script type="text/JavaScript">
var pic = [
"1.jpg",
"2.jpg",
"3.jpg"
"4.jpg"
];
var pix = 0;
var sec = 2;
function pictures() {
document.roll.src = pic[pix];
window.setTimeout("pictures()",1000*sec);
(pix < pic.length-1) ? pix++ : pix=0;
}
</script>
</HEAD>
<BODY onLoad="pictures()">
<img src="1.jpg" name="roll" border="0" alt="">
</BODY>
</HTML>


韦德写道:
08122005 1505 GMT-5

有人可以帮我这个吗?
08122005 1505 GMT-5

Could somebody help me on this?




< HTML>

< HEAD>

< TITLE> CountDown< / TITLE>

< script language =" JavaScript" type =" text / javascript">

<! - 隐藏其他浏览器


//图片之间切换


if(document.images){

Rollpic1 = new Image(); Rollpic1.src =" my_folder / my_photo_1.jpg"

Rollpic2 = new Image(); Rollpic2.src =" my_folder / my_photo_2.jpg"

Rollpic3 = new Image(); Rollpic3.src =" my_folder / my_photo_3.jpg"

Rollpic4 = new Image(); Rollpic4.src =" my_folder / my_photo_4.jpg"

}


//图片数量:

var NumberOfPictures = 4;


//显示图片的计数器

//起始于:

var Pictures = 1;


//以秒为单位的图片切换之间的时间:HowLongBetweenPics

//在SwichPic函数的参数中给出


// - ----- SwitchPic函数-------


函数SwitchPic(HowLongBetweenPics){

if(Pictures< NumberOfPictures){

//如果它不是最后一张图片转到下一张图片

图片++;

}

else {

//如果是最后一张图片转到第一张图片

图片= 1;

}

/ / DEBUG位于屏幕底部的状态栏中

window.status ="切换图片位于+ + HowLongBetweenPics +

" :Rollpic" + Pictures +" .src PicNumber:" + Pictures;

//在什么< IMG>中显示图片标签名为''roll''

document.images [''roll'']。src = eval(" Rollpic" + Pictures +''。src'');

//函数调用自身

CallSwitchPic = setTimeout(" SwitchPic()",HowLongBetw eenPics * 1000);

}

//停止隐藏旧浏览器 - >

< / script>

< / HEAD>


&lt ; BODY onLoad =" SwitchPic(5)"


< img src =" my_folder / my_photo_1.jpg"边界=&QUOT; 0&QUOT; name =" roll">


< / BODY>

< / HTML>

-

Stephane Moriaux et son [moins] vieux Mac



<HTML>
<HEAD>
<TITLE>CountDown</TITLE>
<script language="JavaScript" type="text/javascript">
<!-- hide from other browsers

//Pictures to switch inbetween

if(document.images) {
Rollpic1 = new Image(); Rollpic1.src = "my_folder/my_photo_1.jpg"
Rollpic2 = new Image(); Rollpic2.src = "my_folder/my_photo_2.jpg"
Rollpic3 = new Image(); Rollpic3.src = "my_folder/my_photo_3.jpg"
Rollpic4 = new Image(); Rollpic4.src = "my_folder/my_photo_4.jpg"
}

//Number of pics:
var NumberOfPictures = 4;

// Counter of displayed Pictures
// starts at :
var Pictures = 1;

// Time between pics switching in secs : HowLongBetweenPics
// is given in argument of SwichPic function

// ------ SwitchPic Function -------

function SwitchPic(HowLongBetweenPics){
if(Pictures < NumberOfPictures){
//if it''s not the last picture goto the next picture
Pictures++;
}
else{
// if it was the last picture goto the 1st picture
Pictures = 1;
}
//DEBUG in the status bar at the bottom of the screen
window.status="Switch picture at "+HowLongBetweenPics+
" : Rollpic"+Pictures+".src PicNumber : "+Pictures;
//Display pic in what <IMG> tag named ''roll''
document.images[''roll''].src = eval("Rollpic"+Pictures+''.src'');
//function calls itself
CallSwitchPic=setTimeout("SwitchPic()",HowLongBetw eenPics*1000);
}
// Stop hiding from old browsers -->
</script>
</HEAD>

<BODY onLoad="SwitchPic(5)">

<img src="my_folder/my_photo_1.jpg" border="0" name="roll">

</BODY>
</HTML>
--
Stephane Moriaux et son [moins] vieux Mac


McKirahan写道:
McKirahan wrote:
" Wade" &LT; WA ** @ wadesmart.com&GT;在消息中写道
新闻:11 ********************** @ g43g2000cwa.googlegr oups.com ......
"Wade" <wa**@wadesmart.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
08122005 1505 GMT-5

你好。我正在为当地学校的网页工作(就在学校开学之前)。他们外面雇佣的公司真的搞砸了。
我试图让他们的计算机启动并运行并获得他们的应用程序给他们。

有这个代码翻过来世界历史课的图像。我已经从页面中删除了代码,但页面仍然无法正常运行。

我是一个非常新的JS,虽然我明白我在看什么,但我不
有人可以帮我吗?

韦德

[snip]

让我们简化它 - 很多!

< HTML>
< HEAD>
< TITLE> CountDown< / TITLE>
< script type =" text / JavaScript">
var pic = [
" 1.jpg",
" 2.jpg",
" 3 .jpg"
" 4.jpg"
];
var pix = 0;
var sec = 2;
功能图片(){
document.roll.src = pic [pix];
08122005 1505 GMT-5

Hello. I am working on a webpage for the local school (just before
school starts). Their outside hired company really screwed things up.
Im trying to get their computers up and running and gain access to
their apps for them.

There is this code that flips through images for World History class. I
have removed the code from the page but the page still does not
function.

Im so very new to JS that while I understand what Im viewing, I do not
understand why it doesnt work.

Could somebody help me on this?

Wade

[snip]

Let''s simplify it -- a lot!

<HTML>
<HEAD>
<TITLE>CountDown</TITLE>
<script type="text/JavaScript">
var pic = [
"1.jpg",
"2.jpg",
"3.jpg"
"4.jpg"
];
var pix = 0;
var sec = 2;
function pictures() {
document.roll.src = pic[pix];




只适用于IE

window.setTimeout(" pictures() ,1000 * sec);
(pix< pic.length-1)? pix ++:pix = 0;
}
< / script>
< / HEAD>
< BODY onLoad =" pictures()">
< img src =" 1.jpg"名称= QUOT;辊&QUOT;边界=&QUOT; 0&QUOT; alt ="">
< / BODY>
< / HTML>



that will only work with IE
window.setTimeout("pictures()",1000*sec);
(pix < pic.length-1) ? pix++ : pix=0;
}
</script>
</HEAD>
<BODY onLoad="pictures()">
<img src="1.jpg" name="roll" border="0" alt="">
</BODY>
</HTML>



-

Stephane Moriaux et son [moins] vieux Mac


--
Stephane Moriaux et son [moins] vieux Mac