If you cannot determine how to set the selection in the center:
Check your settings http://deepliquid.com/content/Jcrop_Manual.html#Setting_Options
Something like this (taken from API ref):
<script language="Javascript"> jQuery(function($) { $('#target').Jcrop({ onSelect: showCoords, bgColor: 'black', bgOpacity: .4, setSelect: [ x, y, x1, y1 ], aspectRatio: 16 / 9 }); }); </script>
If w is the width and h is the height desired selection and W is the width of the image , H is the height of the image , the coordinates will be
x = W/2 - w/2 y = H/2 - h/2 x1 = x + w y1 = y + h
(I hope my math is correct :)
Tj-
source share