Using Dropzone.js, I need to determine the decimal values โโof the image when adding files and apply them to its parent .details div. The following code works and returns a warning with the added image width.
myDropzone.on("addedfile", function(file, xhr) { var fr; fr = new FileReader; fr.onload = function() { var img; img = new Image; img.onload = function() { return alert(img.width); }; return img.src = fr.result; }; return fr.readAsDataURL(file); });
The thing is, I have no idea how to assign a width to its parent .details element, which sets the width of the preview preview.
I am trying to replace the warning for this code, but it does nothing.
$(this).parent('.details').css('height',img.height);
I lost a little how to associate the value inside the onload function with its application to its parent class.
source share