-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathimageEditor.php
More file actions
97 lines (94 loc) · 2.22 KB
/
imageEditor.php
File metadata and controls
97 lines (94 loc) · 2.22 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
<head>
<title>Image Editor</title>
<meta charset = "utf-8" />
<script src = "js/jquery-1.11.1.min.js"></script>
<script>
$(function() {
$("input[type = 'file']").bind("change", function() {
var file = this.files[0];
var index = $(this).parent().prevAll().length;
var img = $("#pic").find("img").eq(index).hide()[0];
img.file = file;
var reader = new FileReader();
reader.onload = (function(aImg){
return function(e){
aImg.src = e.target.result;
};
})(img);
reader.readAsDataURL(file);
$(img).fadeIn(1000);
});
});
</script>
<style>
* {
font-family: 'Consolas', 'Microsoft YaHei';
text-align: center;
}
body {
background: #555;
}
h2 {
color: #fff;
text-shadow: 1px 1px 0 #000;
}
form {
background: #fbfbfb;
margin: 0 auto;
padding: 30px 30px 10px;
border-radius: 7px;
width: 500px;
border: 1px solid #eee;
box-shadow: 5px 5px 0 0 #aaa;
}
form div:first-child{
border-top: 1px dashed #c0c0c0;
}
form div {
border-bottom: 1px dashed #c0c0c0;
padding: 5px 0;
}
button {
padding: 4px 12px;
width: 80%;
margin-top: 10px;
}
#pic {
width: 80%;
margin: 20px auto;
}
#pic img{
width: calc(25% - 10px);
margin: 0 5px;
border-radius: 10px;
}
</style>
</head>
<body>
<h2>WeBoth Carousel Figure</h2>
<form action = "admin_action/PageImageAction.php" method = "post" enctype="multipart/form-data">
<div>
<input type = "file" name = "img_a"/>
<input type = "text" name = "describe[]" placeholder = "put url here"/>
</div>
<div>
<input type = "file" name = "img_b"/>
<input type = "text" name = "describe[]" placeholder = "put url here"/>
</div>
<div>
<input type = "file" name = "img_c"/>
<input type = "text" name = "describe[]" placeholder = "put url here"/>
</div>
<div>
<input type = "file" name = "img_d"/>
<input type = "text" name = "describe[]" placeholder = "put url here"/>
</div>
<button class = 'add' type = "submit" >提交</button>
</form>
<div id = "pic">
<img /><img /><img /><img />
</div>
</body>
</html>