Target image and Jcrop hard-coded style properties #123

raphaelyancey opened this Issue Oct 21, 2013 · 0 comments


None yet

1 participant



I'm working on a back-office where the users can crop and re-crop images from the original in different sizes used on the front-end.
I firstly show the actual cropped image for the selected size (let's say "Small"), and allow them to re-crop it from the original by pushing a button that activate Jcrop (on the original image, not the cropped).

So, just before activating Jcrop, I replace the cropped image (/img/small/image.jpg) by the original (/img/image/jpg) with a simple .html().

My targeted image is in a div that aims to show it for the best view by applying this style:

#crop-area #target {
    height: auto; 
    max-width: 100%;

It means : take the full container width, and then adjust the height.

When I click the button to activate Jcrop, the original image shows at its correct width, but the height is actually its original height and not the auto height as specified in the CSS. Because, imo, of the hard-coded style properties applied to the Jcrop image.

A quite similar problem here: #46
I think it has something to do with it.

How to solve this problem ?

NB: before playing with this tricky image replacement, everything worked well! I'm pretty certain it's the CSS.

it seems to happen on Chrome only (fine on Firefox & Safari)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment