JCrop inconsistent click behavior with and without aspectRatio set -


if set minsize, jcrop seems have different click behavior, depending on whether or not additionally setting aspectratio option. if set minsize + aspectratio, have click , drag crop box to display; if set minsize without setting aspectratio, have click crop box.

this easy reproduce on jcrop's advanced demo page (http://deepliquid.com/projects/jcrop/demos.php?demo=advanced):

  • if have "allow new selections" , "minsize/maxsize setting" checked, have click inside image crop box display.
  • if have "allow new selections," minsize/maxsize setting," , "aspect ratio" checked, have click , drag inside image crop box display.

has had luck getting crop box display click in both cases?

you try calling setselect api method on click event. x , y coordinates available you, need specify width , height.

for example:

jcrop_api.setoptions({   setselect:    [10,10,100,100],   aspectratio:2 }); 

where jcrop_api initialized when "attaching" jcrop image:

$j(function($) {     $('#leftimg').jcrop({         onselect: checkselection,         onchange: checkselection,         onrelease: wholeimage,         bgopacity:0.2,         bgcolor:"white"         },function(){jcrop_api = this;}     ); }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -