2

I am showing the image which is uploaded by user in a modal dialog. On this image I am initializing JCrop for cropping the image.

The problem is that I am not able to set the image properly in the dialog, it works ok for images whose size (dimensions) is less than dialog size but for images bigger than dialog size, the image is going out of the dialog.

I tried using boxHeight and boxWidth but this make image non responsive and for smaller size screen the image is going out the dialog.

Basically I am looking for generic solution of showing image in a dialog no matter the image size so that it is displayed properly inside the dialog.

pratik
  • 4,419
  • 8
  • 41
  • 65

2 Answers2

0

Use this may help :

<div class="modal-body" style="overflow: auto; >
......preview here ....
</div>
user3706926
  • 181
  • 2
  • 12
0

The easiest solution is to initialize jcrop in a fixed size div using jcrop option as follows:

boxWidth: 500,
boxHeight: 500,
Pang
  • 9,564
  • 146
  • 81
  • 122
Pashupati Khanal
  • 733
  • 3
  • 11