fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

cropper({ready : function}) not working? #952

Closed DanielEberl closed 6 years ago

DanielEberl commented 6 years ago

Hi, first of all, thank you so much for developing Cropper! I tried various cropping/upload plugins, but this is the only one that works for me!

When i call $("#target").cropper('moveTo',0,0);

from a button click or inside the on('ready') Event

The Canvas DOES move to the top-left corner.

But calling the 'moveTo' function from inside an Event-Handler of Cropper, nothing actually happens.

Does someone have a solution for this?

I'm trying to keep the Image/Canvas always fixed to the top-left corner.

Any help is highly appreciated!

fengyuanchen commented 6 years ago

After try, it works as expected with the following code:

$('#image').cropper({
  ready: function(event) {
    $(this).cropper('moveTo', 0, 0);
  }
});