I am currently utilizing JCrop for photo cropping, and I have encountered an issue where the image clicked on is not displaying at the set width and height. Instead, it appears smaller when loaded in a modal window.
Here is an example of the code snippet:
$("#avatar-photo").html("<img src='" + replace + "' alt='Avatar' class='w3-center w3-round w3-border' style='height: 280px; width: 400px;' id='enlarged-photo'>
However, once loaded in the modal, JCrop automatically adds inline styles like this:
<img src="image.jpg" alt="Avatar" class="w3-center w3-round w3-border" style="height: 152px; width: 152px; display: none; visibility: hidden;" id="enlarged-photo">
I am looking for a way to prevent JCrop from altering the size of the image in the modal window because it ends up being too small.
I hope my issue is clear now, thank you!
Update:
After further investigation, I have identified that the image sizing discrepancy lies within this code:
<img src="image.jpg" alt="Avatar" class="w3-center w3-round w3-border" style="height: 150px; width: 150px; display: block; visibility: visible; border: none; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; opacity: 1;">
My main concern now is how to prevent JCrop from setting a specific height and width in the style attribute?