<!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=utf-8" />
<title>图像上传</title>
<script language="javascript">
function addimg(obj1){
var showimg=document.getElementById("view");
var creatobj=document.createElement("img");
with(creatobj){
src=obj1.value;
var isshow="URL:<font color=/"#FFFF00/">"+src+"</font>; Width:<font color=/"#FFFF00/">"+width+"</font>; Height:<font color=/"#FFFF00/">"+height+"</font>";
if(width>640){height=height/width*640;width=640;}
}
var filetmp=obj1.value.split(".");
var filetype=filetmp[filetmp.length-1]
if(filetype=="jpg"||filetype=="gif"){
document.getElementById("src").innerHTML=isshow;
showimg.innerHTML="";
showimg.appendChild(creatobj);
}else{
alert("只支持JPG和GIF");
obj1.value="";
}
}
</script>
<style type="text/css">
<!--
applet {
text-decoration: none;
}
-->
</style>
</head>
<body>
<div style="margin:0px 10px 0px 0px;float:left;widht=300px;background:#999;">
<form id="form1" name="form1">
<input type="file" name="fileField1" onchange="addimg(this);"/><br />
<input type="file" name="fileField2" onchange="addimg(this);"/><br />
<input type="file" name="fileField3" onchange="addimg(this);"/><br />
<input type="file" name="fileField4" onchange="addimg(this);"/><br />
<input type="file" name="fileField5" onchange="addimg(this);"/><br />
</form>
</div>
<div>
<div style="float:left;width:640px;background:#999;">
<span id="src" style="float:left;color:#FFF;">没有载入图像</span>
<div style="float:right">
<a style="color:#FFF;text-decoration:none;background:#FF0000;" href="#" onclick="document.getElementById('view').innerHTML='<div style=/'/'>没有载入图像</div>';">关</a>
</div>
</div>
<div style="background:#CCC;float:left;width:640px;text-align:center;vertical-align:middle;">
<span id="view" style="width:640px;float:left">
没有载入图像
</span>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图像上传</title>
<script language="javascript">
function addimg(obj1){
var showimg=document.getElementById("view");
var creatobj=document.createElement("img");
with(creatobj){
src=obj1.value;
var isshow="URL:<font color=/"#FFFF00/">"+src+"</font>; Width:<font color=/"#FFFF00/">"+width+"</font>; Height:<font color=/"#FFFF00/">"+height+"</font>";
if(width>640){height=height/width*640;width=640;}
}
var filetmp=obj1.value.split(".");
var filetype=filetmp[filetmp.length-1]
if(filetype=="jpg"||filetype=="gif"){
document.getElementById("src").innerHTML=isshow;
showimg.innerHTML="";
showimg.appendChild(creatobj);
}else{
alert("只支持JPG和GIF");
obj1.value="";
}
}
</script>
<style type="text/css">
<!--
applet {
text-decoration: none;
}
-->
</style>
</head>
<body>
<div style="margin:0px 10px 0px 0px;float:left;widht=300px;background:#999;">
<form id="form1" name="form1">
<input type="file" name="fileField1" onchange="addimg(this);"/><br />
<input type="file" name="fileField2" onchange="addimg(this);"/><br />
<input type="file" name="fileField3" onchange="addimg(this);"/><br />
<input type="file" name="fileField4" onchange="addimg(this);"/><br />
<input type="file" name="fileField5" onchange="addimg(this);"/><br />
</form>
</div>
<div>
<div style="float:left;width:640px;background:#999;">
<span id="src" style="float:left;color:#FFF;">没有载入图像</span>
<div style="float:right">
<a style="color:#FFF;text-decoration:none;background:#FF0000;" href="#" onclick="document.getElementById('view').innerHTML='<div style=/'/'>没有载入图像</div>';">关</a>
</div>
</div>
<div style="background:#CCC;float:left;width:640px;text-align:center;vertical-align:middle;">
<span id="view" style="width:640px;float:left">
没有载入图像
</span>
</div>
</div>
</body>
</html>