forked from tybro0103/jWindowCrop
-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo.html
69 lines (65 loc) · 1.74 KB
/
demo.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>jWindowCrop</title>
<link href="jWindowCrop.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.jWindowCrop.js"></script>
<style type="text/css">
body {
font-family:sans-serif;
font-size:13px;
}
#results {
font-family:monospace;
font-size:20px;
}
/* over ride defaults */
.jwc_frame {
border:5px solid black;
} .jwc_controls {
height:24px;
} .jwc_zoom_in, .jwc_zoom_out {
display:block; background-color:transparent;
cursor:pointer;
width:16px; height:16px;
float:right; margin:4px 4px 0px 0px;
text-decoration:none; text-align:center;
font-size:16px; font-weight:bold; color:#000;
} .jwc_zoom_in {
background-image:url(images/round_plus_16.png);
} .jwc_zoom_out {
background-image:url(images/round_minus_16.png);
} .jwc_zoom_in::after {
content:"";
} .jwc_zoom_out::after {
content:"";
}
/* over ride defaults */
</style>
</head>
<body>
<img id="target3" class="crop_me" alt="" src="images/dock.jpg" />
<div id="results">
<b>X</b>: <span id="crop_x"></span><br />
<b>Y</b>: <span id="crop_y"></span><br />
<b>W</b>: <span id="crop_w"></span><br />
<b>H</b>: <span id="crop_h"></span><br />
</div>
<script type="text/javascript">
$(function() {
$('.crop_me').jWindowCrop({
targetWidth: 400,
targetHeight: 300,
loadingText: 'hello world',
onChange: function(result) {
$('#crop_x').text(result.cropX);
$('#crop_y').text(result.cropY);
$('#crop_w').text(result.cropW);
$('#crop_h').text(result.cropH);
}
});
});
</script>
</body>
</html>