<!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" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>AttachEvent</title>
<style type="text/css">
<!--
body{font-size:12px;}
#txtFile{font-family:Arial, Helvetica, sans-serif;font-weight:bold;color:#6699FF;}
-->
</style>
<script language="javascript" type="text/javascript">
<!--
function FileBox(ID)
{
var faceObj = document.createElement("div");
faceObj.style.width = "66px";
faceObj.style.height = "24px";
faceObj.style.border = "1px solid #336699";
faceObj.style.overflow = "hidden";
var inputBox = document.createElement("input");
inputBox.type = "file";
inputBox.style.marginLeft = "-155px";
inputBox.style.marginTop = "-4px";
inputBox.style.height = "32px";
if(IsIE())
{
inputBox.style.filter = "alpha(opacity=0)";
}
else
{
inputBox.style.opacity = "0.0";
}
inputBox.id = ID;
inputBox.style.position = "relative";
inputBox.style.top = "-18px";
inputBox.style.left = "0px";
inputBox.style.zIndex = "500";
var inText = document.createElement("div");
inText.style.position = "relative";
inText.style.cursor = "default";
inText.style.fontFamily = "'微软雅黑','宋体'";
inText.style.fontSize = "12px";
inText.style.zIndex = "-1";
inText.style.left = "10px";
inText.style.top = "4px";
inText.innerHTML = "浏览...";
inputBox.onchange = function()
{
var txt = document.getElementById("txtFile");
txt.innerHTML = inputBox.value;
}
faceObj.appendChild(inText);
faceObj.appendChild(inputBox);
document.body.appendChild(faceObj);
}
function CreateBox(ID)
{
if(IsIE())
{
window.attachEvent("onload",function(){FileBox(ID);});
}
else
{
window.addEventListener("load",function(){FileBox(ID);},true);
}
}
function IsIE()
{
if(window.navigator.appName.indexOf("Microsoft") >= 0)
return true;
else
return false;
}
CreateBox("winid");
-->
</script>
</head>
<body>
<input type="hidden" name="xBox" id="xBox" />
<div id="txtFile"></div>
</body>
</html>
让网页中上传的浏览按钮更漂亮
4星 · 超过85%的资源 需积分: 15 26 浏览量
2008-08-29
14:45:37
上传
评论
收藏 1KB RAR 举报
tombluse
- 粉丝: 2
- 资源: 16
最新资源
- 407000001.fasset
- J-20240402998-HTE-HTE-2947110DA-D3_整车运动控制器-电压渐变(缓升缓降)-检测报告-XS-汽车及零部件检测中心.pdf.crdownload
- Excel表格VBA-获取文件夹内所有文件路径.zip
- 文件移动.zip
- 反射源代码,源代码,源代码,源代码
- CAJViewer 9.0_x64-setup.exe
- servant C++语言框架rpc的源码实现 tools C++语言框架IDL工具的源码实现 util C++语言.7z
- 使用pyqt创建一个登录具有动态背景的登陆界面
- 实验名称 调幅波信号的解调
- 实验名称 振幅调制器(利用乘法器)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈