scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 304 forks source link

Forwarding an event to .cropit-image-preview #121

Closed asaf-yonay closed 8 years ago

asaf-yonay commented 8 years ago

Hey all, thanks for this really great library.

I'm not sure if this is an issue or has been covered before, but is there a way to simulate a drag event on the image container? The one labelled .cropit-image-preview?

I imagine it much like the drag handler option in jQuery UI.

I tried triggering an event directly on the said above selector, but didn't get much success.

Thanks!

asaf-yonay commented 8 years ago

Well, I guess I was over-eager to post. :)

Using a simple trigger event works if you bind both touchstart and touchmove:

$(handler).on('touchstart touchmove',function(e){ $('.cropit-image-preview').trigger(e); });