I have div which have 600px width and 631px height initially .
There is two input field where user can change width and height . Inside this div i have an image
so the structure
<div class="container-div">
<img src="img.jpg" class="new-img">
</div>
so when user resize the div size , image also need to be resize proportionally. It will not be stretched .
How i can do this ?
Note : i wrote the code for to resize the div after user entering their width and height . so i actually try to get code after div resize .
$(".input1, .input2").on("change",function(){
measurement_change();
});
function measurement_change(){
after calculation i set new_width and new_height
$(".container-div").css("width", new_width);
$(".container-div").css("height", new_height);
After this i hav e to resize image propotionally
}
Please check.