File tree 4 files changed +37
-5
lines changed
4 files changed +37
-5
lines changed Original file line number Diff line number Diff line change 51
51
border-bottom : 1px solid # bdc3c7 ;
52
52
margin : 30px 0 ; }
53
53
54
- # image-preview {
54
+ # image-preview , # callback-preview {
55
55
width : 400px ;
56
56
height : 400px ;
57
57
position : relative;
58
58
overflow : hidden;
59
59
background-color : # ffffff ;
60
60
color : # ecf0f1 ; }
61
- # image-preview input {
61
+ # image-preview input , # callback-preview input {
62
62
line-height : 200px ;
63
63
font-size : 200px ;
64
64
position : absolute;
65
65
opacity : 0 ;
66
66
z-index : 10 ; }
67
- # image-preview label {
67
+ # image-preview label , # callback-preview label {
68
68
position : absolute;
69
69
z-index : 5 ;
70
70
opacity : 0.8 ;
Original file line number Diff line number Diff line change 61
61
margin : 30px 0 ;
62
62
}
63
63
64
- #image-preview {
64
+ #image-preview , #callback-preview {
65
65
width : 400px ;
66
66
height : 400px ;
67
67
position : relative ;
Original file line number Diff line number Diff line change 18
18
preview_box : "#audio-preview" ,
19
19
no_label : true
20
20
} ) ;
21
+
22
+ $ . uploadPreview ( {
23
+ input_field : "#callback-upload" ,
24
+ preview_box : "#callback-preview" ,
25
+ label_field : "#callback-label" ,
26
+ success_callback : function ( ) {
27
+ alert ( "File will now be previewed" ) ;
28
+ }
29
+ } ) ;
21
30
} ) ;
22
31
</ script >
23
32
< link rel ="stylesheet " href ="assets/css/application.css " type ="text/css " />
@@ -144,6 +153,29 @@ <h2>Image File Example</h2>
144
153
145
154
< hr />
146
155
156
+ < h2 > Callback Example</ h2 >
157
+ < pre >
158
+ <script type="text/javascript">
159
+ $(document).ready(function() {
160
+ $.uploadPreview({
161
+ input_field: "#callback-upload",
162
+ preview_box: "#callback-preview",
163
+ label_field: "#callback-label",
164
+ success_callback: function() {
165
+ alert("File will now be previewed");
166
+ }
167
+ });
168
+ });
169
+ </script>
170
+ </ pre >
171
+
172
+ < div id ="callback-preview ">
173
+ < label for ="callback-upload " id ="callback-label "> Choose File</ label >
174
+ < input type ="file " name ="image " id ="callback-upload " />
175
+ </ div >
176
+
177
+ < hr />
178
+
147
179
< h2 > Audio File Example</ h2 >
148
180
< pre >
149
181
<style type="text/css">
You can’t perform that action at this time.
0 commit comments