I'm facing an issue with a resizable div that has text inside. When I resize the div, the last line of the text goes beyond the boundaries of the div. How can I ensure that all the text fits within the resizable div while maintaining the appropriate font size?
Check out this sample code:
resize: function(e, ui)
{
var newDiagonal = getContentDiagonal();
var ratio = newDiagonal / initDiagonal;
$("#content").css("font-size", initFontSize + ratio * 3);
}
The image below illustrates the problem:
https://i.sstatic.net/DRnQF.png
You can find the code here on Jsfiddle..!