This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
69 lines (59 loc) · 1.47 KB
/
test.html
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<script type="text/javascript" src="js/jquery.Jcrop.js"></script>
<link rel="stylesheet" href="css/jquery.Jcrop.css"/>
<script type="text/javascript" src="js/bootstrap.js"></script>
<link rel="stylesheet" href="css/bootstrap.css"/>
<script type="text/javascript" src="jCropModal.js"></script>
</head>
<body>
<div style="width: 900px; padding: 10px 50px;">
<form enctype="multipart/form-data" method="post" action="upload.php" id="form1">
<div class="row">
<label for="filesToUpload">Select Files to Upload</label><br />
<input type="file" name="filesToUpload" id="filesToUpload" />
</div>
<div class="row submit">
<input type="submit" value="Upload" />
</div>
</form>
</div>
<div id="infoImg"></div>
<script>
$(document).ready(function(){
$('#filesToUpload').jCropModal({
width: 290
}, [{
width: 100,
height: 50,
title: 'rararara'
}, {
width: 100,
height: 50
}], {
height: 300,
title: 'sdfsfs'
});
$('#form1').on('submit', function(e){
e.preventDefault();
var formData = new FormData();
$('#filesToUpload').jCropAppendFormData(formData);
$.ajax({
type: "POST",
cache: false,
//dataType: "json",
processData: false,
contentType: false,
data: formData,
url: 'test.php'
}).done( function( data, textStatus, jqXHR ) {
$('#infoImg').html(data);
});
});
});
</script>
</body>
</html>