Dynamic.html 2.6 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="divport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>发动态</title>
    <link rel="stylesheet" href="../css/init.css">
    <link rel="stylesheet" href="../css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_793738_etrccfh2qxm.css">
    <link rel="stylesheet" href="../css/diseaseColumn.css">
    <link rel="stylesheet" href="../css/ChatCircle.css">
    <link rel="stylesheet" href="../css/chat.css">
    <link rel="stylesheet" href="../css/weui.css">
    <link rel="stylesheet" href="../css/myweui.css">
    <script src="../js/fontsize.js"></script>
</head>
<body>
<div class='box'>
    <div class='textarea_box'>
        <textarea class='textarea' placeholder='详细描述会为您带来最快速的成交哦'></textarea>
    </div>
    <div class="weui-uploader">
        <div class="weui-uploader__hd">
            <p class="title">上传图片(最多九张)</p>
        </div>
        <div class="weui-uploader__bd">
            <ul class="weui-uploader__files" id="uploaderFiles">
            </ul>
            <div class="weui-uploader__input-box">
                <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple/>
            </div>
        </div>
    </div>
</div>
<!--dibu-->
<div class="null_box"></div>
<div class="submit_btn">发布</div>
<script src="../js/jquery-2.1.0.js"></script>
<script src="../js/weui.js"></script>
<script src="../js/myweui.js"></script>
<script>
    $(function () {
        var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
            $gallery = $("#gallery"), $galleryImg = $("#galleryImg"),
            $uploaderInput = $("#uploaderInput"),
            $uploaderFiles = $("#uploaderFiles")
        ;

        $uploaderInput.on("change", function (e) {
            var src, url = window.URL || window.webkitURL || window.mozURL, files = e.target.files;
            for (var i = 0, len = files.length; i < len; ++i) {
                var file = files[i];

                if (url) {
                    src = url.createObjectURL(file);
                } else {
                    src = e.target.result;
                }

                $uploaderFiles.append($(tmpl.replace('#url#', src)));
            }
        });
        $uploaderFiles.on("click", "li", function () {
            $galleryImg.attr("style", this.getAttribute("style"));
            $gallery.fadeIn(100);
        });
        $gallery.on("click", function () {
            $gallery.fadeOut(100);
        });
    });
</script>
</body>
</html>