I have been working on a JavaScript (jQuery) function to calculate the maximum width of all child and children's-child elements within a specific div element.
Here is the code I have written so far:
function setBodyMinWidth(name){
var max = 0;
$(name).find('*').each(function(){
var width = $(this).outerWidth(true);
if (width > max){
max = width;
}
});
$("body").css("minWidth", max+"px");
Unfortunately, it doesn't seem to be functioning correctly. The issue I am facing is that on my website, content with float: "right";
overlaps the page content when the browser window size is too small. My website is currently under construction online, and if you need to see some source code, please feel free to visit here.