html{
height: 100%;
}
body{
background: url("images/timg.jpg") no-repeat;
background-size: cover;
}
#wrap{
width:500px;
height:350px;
margin:200px auto;
box-shadow: 0px 0px 10px #cc33ff;
font-family:'Microsoft yahei';
}
#box{
position:relative;
width:500px;
height:350px;
}
#bin{
width:150px;
height:35px;
background:#ddd;
text-align:center;
line-height:35px;
margin:0 auto;
color: #63f;
}
#box span{
display:block;
width:192px;
margin:0 auto;
line-height:350px;
color: #3f3;
font-weight: bold;
}
#box p{
position:absolute;
left:0;
bottom:-50px;
width:75px;
height:25px;
margin-top:10px;
color: #c00;
}
#box img{
width:100px;
height:100px;
}
可以将文件拖放到这里!!
共0张图片
var oBox=document.getElementById("box");
var oSpan=document.getElementsByTagName("span")[0];
oBox.addEventListener("dragenter",drag,false);
oBox.addEventListener("dragover",drag,false);
oBox.addEventListener("dragleave",drag,false);
oBox.addEventListener("drop",drag,false);
function drag(ev){
ev.preventDafault();
switch(ev.type){
case "dragenter":
oSpan.style.display="none";
break;
case "dragover": break;
}
}
2018-1-31 12:23 上传
点击文件名下载附件
下载积分: 黑币 -5
58.33 KB, 下载次数: 3, 下载积分: 黑币 -5