Jcrop default selection box
Asked Answered
B

1

6
$('#previewImg').Jcrop({
        onChange: showCoords,  
        onSelect: showCoords,
        minSize:[300,100],
        maxSize:[900,900],
        aspectRatio: 3/1
    });

I have an image use jcrop, however i need to have a default box 300,100 before user click on image to make it appear.

so the box will already appear & at center before user click the image.

Brower answered 5/1, 2014 at 7:17 Comment(0)
K
10

you have to set the setSelect option while creating the jcrop

$('#previewImg').Jcrop({
        onChange: showCoords,  
        onSelect: showCoords,
        setSelect: [0, 160, 160, 0],// you have set proper x and y coordinates here
        minSize:[300,100],
        maxSize:[900,900],
        aspectRatio: 3/1
    });

Here is the demo for setSelect option http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced

Kirimia answered 5/1, 2014 at 7:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.