找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1514|回复: 0
打印 上一主题 下一主题
收起左侧

html5素材

[复制链接]
跳转到指定楼层
楼主
ID:281105 发表于 2018-1-31 12:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
  <style>
                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;
                }
  </style>
</head>
<body>
                <div id='wrap'>
                        <div id='box'>
                                <span>可以将文件拖放到这里!!</span>
                                <p>共0张图片</p>
                        </div>
                        <div id='bin'>回收站</div>
                </div>
                <script>
                        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;
                                                
                                        }
                                
                        }
                </script>
</body>
</html>


素材.zip

58.33 KB, 下载次数: 5, 下载积分: 黑币 -5

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表