本来觉得这个系统会很复杂,但把每个部分都分析清楚后,其实需要的技术并不高。不过当我把各个功能函数都整理好准备进行封装时,却发现要把程序封装不是那么容易,因为程序跟html的耦合度太高。然后我逐步把程序中操作html相关的部分分离出来,首先把简单的分离,接着是文件列表,然后是file控件,最后是一些提示性程序。经过几次尝试才把整个结构封装好。
仿163网盘无刷新文件上传系统
.fu_list {
width:600px;
background:#ebebeb;
font-size:12px;
}
.fu_list td {
padding:5px;
line-height:20px;
background-color:#fff;
}
.fu_list table {
width:100%;
border:1px solid #ebebeb;
}
.fu_list thead td {
background-color:#f4f4f4;
}
.fu_list b {
font-size:14px;
}
/*file容器样式*/
a.files {
width:90px;
height:30px;
overflow:hidden;
display:block;
border:1px solid #BEBEBE;
background:url(/attachment.php?aid=8332&noupdate=yes) left top no-repeat;
text-decoration:none;
}
a.files:hover {
background-color:#FFFFEE;
background-position:0 -30px;
}
/*file设为透明,并覆盖整个触发面*/
a.files input {
margin-left:-350px;
font-size:30px;
cursor:pointer;
filter:alpha(opacity=0);
opacity:0;
}
/*取消点击时的虚线框*/
a.files, a.files input {
outline:none;/*ff*/
hide-focus:expression(this.hideFocus=true);/*ie*/
}
上传文件
添加文件:
文件路径
温馨提示:最多可同时上传 个文件,只允许上传 文件。
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 在线演示 http://img.jb51.net/online/FileUpload/FileUpload.htm打包文件下载 http://xiazai.jb51.net/200810/yuanma/FileUpload.rar
推荐阅读
Javascript中Eval函数的使用说明
举个小例子: 复制代码 代码如下:var the_unevaled_answer = "2 + 3"; var the_evaled_answer = eval("2 + 3"); alert("the un-evaled answer is " + the_unevaled_answer + " and the evaled answer is " + the_e>>>详细阅读
本文标题:javascript仿163网盘无刷新文件上传系统
地址:http://www.17bianji.com/kaifa2/JS/29320.html
1/2 1