1

This is not a question, just a tip after trying to get this to work myself. Maybe people know about it already but I found no documentation of it (on the Jcrop site or elsewhere).

This is actually just an undocumented feature, looking at the source code for Jcrop I noticed that it accepted a function as a second argument after the settings, which gets called after Jcrop has finished loading. So just enter your function there and presto!

  $('#imagetocrop')
    .Jcrop(
      {
        /* settings go here */
      },
      function() { alert('Jcrop has finished loading!) });

Note: The settings object is NOT optional in this case. the callback only works as a second argument. You can send an empty settings object { } and it works just fine, but why you'd need a callback for such a simple Jcrop function is beyond me...

Happy coding!

1 Answer 1

1
 $('#imagetocrop').Jcrop(
   {
     /* settings go here */
   },
   function() 
   { 
     alert('Jcrop has finished loading!) 
   });
2
  • 1
    @Jan Just moving it to the answer column. I tagged it as 'community wiki' so as not to take credit, and I just upvoted your original content. Sep 14, 2012 at 12:44
  • Figured as much, was nice to be able to close the "question" too. Thanks mate! :)
    – Jan
    Sep 14, 2012 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.