The functionality I am looking for is that when uploading an image, the user can resize, zoom and save it with that scale, but I have not found a way to do that.
The way I have it implemented is that the image is displayed once it is loaded, as shown below:
And that when clicking to zoom, the image can be made larger, ending something like this:
This is my code for that part of the page, with its JavaScript part to display the loaded image:
$(document).on('click','.viewDesign',function(){
if($(this).parent().find('input')[0].files[0]){
$('#designPreview').attr('src', window.URL.createObjectURL($(this).parent().find('input')[0].files[0]));
}
else if($(this).data('file')){
$('#designPreview').attr('src', $(this).data('file'));
}
});
.container
img.design#designPreview(src="img/diseno/diseno.png")
.escala
p Escala
.buttons
i(type='button') -
i(type='button') +
I think you can do it with this code, the comments are explanatory:
Any additional information, here is the source .
successes!