學習JAVASCRIPT

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>照相簿之四</title>
</head>
<script>
var header="images/";
var arr_file=["untitled.bmp","untitled2.bmp","untitled3.bmp","untitled4.bmp"];
var i=1;
var n=5;
function turnnext(y)
{
if(y==0)
{
document.imgfile.src=header+arr_file[y];
document.theform.txturl.value=header+arr_file[y];
y=-1;
}
edxx();
id=setTimeout("turnnext()",1000);
}

function edxx(y)
{
if (n==0||n==y) {
n=5;
if (i>3) i=0;
x=i++;
document.imgfile.src=header+arr_file[x];
document.theform.txturl.value=header+arr_file[x];
document.theform.coutn.value="";
}
else {
document.theform.coutn.value=n;
n=n-1;
}

}

function self()
{
clearTimeout(id);
edxx(n);
turnnext(n);
}
</script>
<body onload="turnnext(0);">
<div id="mydiv"><img name="imgfile" alt="點擊顯示下一幅圖片!"  onclick="self();"/><br />
<form name="theform">
<input name="coutn" type="text" style="border:0"/>
<input name="txturl" type="text" /></form></div>
</body>
</html>
 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值