scottcheng / cropit

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

For responsive support #130

Open avishwakarma opened 8 years ago

avishwakarma commented 8 years ago

Hi,

Is there any way I can set the output image width, height instead setting export zoom or canvas preview area.

For example in smaller devices I am taking the preview area 100% of the device width, but wanted to upload the image 400x300 px

This will help us putting Cropit in responsive designs.

sidaurukfreddy commented 8 years ago

Hi did you solved this issue ? i need to add class img-responsive in the images, where should put class img-responsive ?

phpMagpie commented 8 years ago

+1 for being able to set export dimensions, would simplify things hugely.

sidaurukfreddy commented 8 years ago

hi @phpMagpie how can you handle about responsive cms ? did you make diffrent css between desktop adn mobile, please respond, thanks

phpMagpie commented 8 years ago

I have not been able to use this responsively. We have to set a preview window size that works across all screen sizes which means we disable the feature on mobile phones at present.

sidaurukfreddy commented 8 years ago

Hello @phpMagpie please click this Demo

i use that demo for my cms working on now, but i have issue how can when click button crop result cropped images stay in the place change preview images not in new windows, need some help about this, Thanks

phpMagpie commented 8 years ago

@sidaurukfreddy I'm snowed under on project work at present so have no time to look into this just now :(

sidaurukfreddy commented 8 years ago

Yea i know but the author nothing respond, so i tagging in you, i'm not experts about jquery, i knew jquery about 1 year lah, if you free please help la ya, Thanks

martingg88 commented 8 years ago

any idea how to solve this issue?

jupitercow commented 8 years ago

I am doing this on responsive, and it is working really well for me: https://github.com/scottcheng/cropit/issues/148#issuecomment-178707592

I am adjust the dimensions dynamically on imageLoaded and resize. When I adjust the dimensions, I also adjust the zoom. The API is working really well for this, and so far, I am getting exact dimensions in my output.

phpMagpie commented 8 years ago

I can confirm that the solution suggested by @jupitercow works a treat!