87,992
社区成员
发帖
与我相关
我的任务
分享<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<style>
#c{ text-align:left; font-size:12px;}
#c div.btn{ width:90px; height:30px; border:1px solid #9C9C9B; background:url(btn.gif) 0 0 no-repeat;}
#c div.btn:hover{ background:url(btn.gif) 0 -30px no-repeat}
#c .file{width:90px; height:30px; opacity:0; cursor:pointer;}
#c .bar{
width:350px; display:none; padding:0 5px 5px; background:#FFFFE1; border:1px solid #9C9C9B; margin-top:10px;
}
#c .list{ overflow:hidden; margin-top:5px; position:relative}
#c .loadbar{ width:100px; height:10px; overflow:hidden; border:1px solid #9C9C9B; float:left; margin-right:5px;}
#c .bai{ float:left; display:inline-block;_zoom:1;*display:inline; width:35px; margin-left:10px; }
#c .info{float:left; height:14px; display:inline-block;_zoom:1;*display:inline; width:165px;overflow:hidden;word-break: break-all;word-wrap: break-word;}
#c .block{ width:0; height:10px; background:#9C9C9B;}
#c a{color:#2D5169; position:absolute; right:5px; top:0;}
</style>
<body>
<div id="c">
</div>
<script language="javascript" type="text/javascript">
(function(doc){
var window = this;
var _extend = function(obj,o){
for(var name in o){
obj[name] = o[name];
}
}
var _$q = function(name,p){
return p.getElementsByTagName(name);
}
var _$c = function(name,p){
var elem = doc.createElement(name);
p&&p.appendChild(elem);
return elem;
}
window.upload = {
options : {
maxSize : 35, //30m的意思
message : "文件不能超过{size}m"
},
init : function(options){
_extend(this.options,options);
_extend(this,this.options);
if(!this.elem || !this.elem.nodeName){
return;
}
var t = new Date().getTime();
var ie = doc.all,
self = this;
if(ie){
this.elem.innerHTML = [
"<object id='flash_z' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='90' height='30'>",
"<param name='FlashVars' VALUE='' />",
"<param name='wmode' value='transparent'/>",
"<param name='Movie' value='upload.swf?"+t+"' />",
"<param name='Src' value='upload.swf?"+t+"' />",
"<param name='WMode' value='Window' />",
"<param name='Scale' value='NoScale' />",
"<param name='BGColor' value='#cccccc' />",
"<param name='AllowNetworking' value='all' />",
"<param name='AllowFullScreen' value='true' />",
"<param name='AllowScriptAccess' value='always' />",
"</object><div class='bar'></div>"
].join("");
this.flash = this.elem.childNodes[0];
this.bar = this.elem.childNodes[1];
this.flash.style.display = "none";
this.flashComplete = function(){
alert("弹出了这个 说明as 调用了 js"); //看这里
this.flash.style.display = "block";
this.flash.init(this.url+"_____"+this.maxSize); //这里是js调用as的
}
}
}
}
})(document);
upload.init({
elem : document.getElementById("c"),
url : "upload.php",
maxSize : 30
});
</script>
</body>
</html>