js81:Image对象,几张图像缓存完之后动画显示,form.elements[],document.images[]
原文发布时间为:2008-11-09 —— 来源于本人的百度文章 [由搬家工具导入]
<!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=gb2312" />
<script type="text/javascript">
var imgs=new Array(3);
var curimg=0;
var imgload=0;
var start;
for(var i=0;i<imgs.length;i++){
imgs[i]=new Image();
imgs[i].src= "../../图片/视觉/image00"+(i+1)+".gif";
imgs[i].onLoad=count();
}
function count(){
imgload++;
if(imgload==3)
start=setInterval("showimg();",1000);
}
function showimg(){
if(curimg==2)
curimg=0;
else
curimg++;
document.pic.src=imgs[curimg].src;
}
</script>
<title>js8</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="textfield"/>
</label>
<p>
<label>
<input name="an1" type="button" id="an1" value="aaaa" onclick="document.form1.elements[0].value=this.value;" />
</label>
<label>
<input name="an2" type="button" id="an2" value="bbbb" onclick="this.form.elements[0].value=this.value" />
</label>
<label>
<input name="an3" type="button" id="an3" value="cccc" onclick="this.form.textfield.value=this.value" />
</label>
<label>
<input name="an4" type="button" id="an4" value="dddd" onclick="window.open('','ad','height=300,width=300');" />
</label>
</p>
</form>
<input name="an42" type="button" id="an42" value="showanotherpicture" onclick="document.pic.src='../../图片/视觉/image003.gif'" />
<img src="../../图片/视觉/image002.gif" name="pic"/>
<script type="text/javascript">
alert(document.title+" "+document.URL+" "+document.lastModified);
document.title="love";
document.write("hello\n","world","!");
document.write(document.images.length);
document.write(document.images[0].name);
</script>
</body>
</html>
最新文章
- haproxy 实现多域名证书https
- Maven安装与配置
- php插件开发
- 1、webservice的简单使用
- JUnit 测试
- 大前端时代已经到来!传智播客2015之WEB前端视频教程(全套教程共15G)
- DevOps 高效 shell 命令
- [转][色彩 A] – 永远不要使用纯黑
- 关于delphi XE7中的动态数组和并行编程(第一部分)
- [Hive - LanguageManual ] Windowing and Analytics Functions (待)
- cloudstack4.2+xenserver6.0.2 详细配置攻略
- [转载]ASP.NET MVC URL重写与优化(进阶篇)-继承RouteBase玩转URL
- png24是支持Alpha透明的。。。。。。
- HDU 1495 非常可乐 BFS搜索
- iOS开发之详解正则表达式
- css层叠机制说明
- Java 常见数据交换格式——xml、json、yaml
- dom4j 解析XML文件
- oracle 12C版本的下载安装
- Django学习手册 - 如何安装django 和 python ?