Dynamic.html
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!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>