scottcheng / cropit

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

How to set multiple preview divs? #138

Closed Manmade closed 8 years ago

Manmade commented 8 years ago

Does anybody know how to set so you can have a different preview class? So I can have something like this: $('.image-editor').cropit({ preview:$(".cropit-image-preview") }); $('.image-editor2').cropit({ preview:$(".cropit-image-preview2") }); As it is now it always shows the image in .cropit-image-preview and I need to be able to set the second one to show the image in cropit-image-preview2. I really need to get this working, thanks :-)

sidaurukfreddy commented 8 years ago

You should make each css and js also

sidaurukfreddy commented 8 years ago

ah i got thiss issue too, already make multiple css but nothing working, i'm focus on cropit-image-preview too, where is the author lah

sidaurukfreddy commented 8 years ago

Hello i have been solved this issue, hope someone found this lah ya ! first of all , this class is main

cropit-image-preview
for all crop and resize so you will success using multiple images preview, so i did hacky the plugin then please open your jquery.cropit.js and search it class cropit-image-preview line 927 then i copy become 2 files then change the one as like what i want

for example this is my html

<div class="cropit-image-preview-users">
                    <div class="error-msg"></div>
 </div>

then copy your js and rename up to you then goes to lin2 926 then change it

      PREVIEW: 'cropit-image-preview-users', //change based on your div

Thanks

sidaurukfreddy commented 8 years ago

Shit happend to me, all working fine but validations errors not working, where is the author lah

HardikPatel88 commented 8 years ago

Hello sidaurukfreddy,

I have tryed as you said but not working . please send me demo if you have . my mail id : hardik.patel@imobdevtech.com

thanks in advance

Manmade commented 8 years ago

Hi sidaurukfreddy, did you get this to work? And how? Do you have a demo? Thanks :-)

scottcheng commented 8 years ago

To the original question, the option to change preview element is $preview, not preview. Please refer to the doc http://scottcheng.github.io/cropit/#docs-options-preview

los5szus4s commented 7 years ago

Hi, i have another question how to upload multiple image to the same image-preview-div . ? Please look at this question https://github.com/scottcheng/cropit/issues/212