javascript - Cannot get access to the Jquery JCrop api -


i trying access jcrop api ( http://deepliquid.com ).

here code snippet :

// selected image has been loaded $('#selectedimage').load(function() {    var jcrop_api = $('#selectedimage').jcrop({                 touchsupport:     true,                 onselect: cropselected     });     jcrop_api.setselect([ 100,100,200,200 ]); }); 

i in console : typeerror: result of expression 'jcrop_api.setselect' [undefined] not function.

i aware can pass parameters options, use api perform other stuff (setimage, etc.)

any ideas ? lot !

you calling api in wrong way...

change this:

   var jcrop_api = $('#selectedimage').jcrop({                 touchsupport:     true,                 onselect: cropselected     }); 

to this:

   var jcrop_api = $.jcrop('#selectedimage',{                 touchsupport:     true,                 onselect: cropselected     }); 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -