Vay Vay -4 years ago 120
Javascript Question

Bug when croppie div starts closed

I know that this is a little bit specific and related to a jquery script named croppie but maybe someone could help me out here nevertheless. Maybe it's also more a javascript or bootstrap issue?

However, I'm using Bootstrap and serve a function to change the profile image with croppie. The croppie div isn't visible until you collapse that div with a click.
However, this way the image size is messed up. It seems to take the full image size.

When I'm setting a timer with

setTimeout(function() { ('#pimg').removeClass('in').addClass('out'); },150);

for example to start the page uncollapsed (to see the contents of the actual croppie div) everything works fine. But not when I'm starting with a collapsed (closed) croppie div, and that's what I need. (This is a hacky solution that is also not reliable since it seems that the image has to be loaded first.)

Is there any workaround or way to fix this? I tried to set the width/height of the container to a specific size, but there's still the same problem. It's something about the class as you can see here:

enter image description here

Answer Source

It is a know bug of croppie. I'm afraid you have to use some other library for that purpose.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download