forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery-cropbox-tests.ts
45 lines (33 loc) · 982 Bytes
/
jquery-cropbox-tests.ts
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
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="jquery-cropbox.d.ts"/>
var cropboxWithDefaultSettings = $("#element").cropbox();
var cropboxOptions: jQueryCropBox.CropboxOptions = {
height: 500,
zoom: 5,
width: 0.5,
};
var cropboxWithOptions = $("#element").cropbox(cropboxOptions);
cropboxWithOptions.zoomIn();
cropboxWithOptions.zoomOut();
cropboxWithOptions.zoom(50);
var cropDragOption: jQueryCropBox.CropboxDragOptions = {
startX: 10,
startY: 0,
dx: 100,
dy: 100
};
cropboxWithOptions.drag(cropDragOption);
var cropboxSetCropOption: jQueryCropBox.CropboxSetCropOptions = {
cropX: 10,
cropY: 10,
cropW: 50,
cropH: 50
};
cropboxWithOptions.setCrop(cropboxSetCropOption);
cropboxWithOptions.update();
cropboxWithOptions.getDataURL();
cropboxWithOptions.getBlob();
cropboxWithOptions.remove();
cropboxWithOptions.on("cropbox",(e: Event, data: any, img: jQueryCropBox.Cropbox) => {
//DoStuff
});