I have a container of fixed height and fixed width. Within that i have two more div's one is top, another is bottom with fixed width. If height of the top increases the text inside the bottom div goes beyond the height of the container, I dont want like that. I want to know how much text goes beyond the container height and what is that text. I want to save that text in a variable.
my jQuery code what i wrote:
var conheight = $("#container").height();
console.log("conheight",conheight);
var botheight = $("#bottom").height();
console.log("botheight",botheight);
var topheight = $("#top").height();
console.log("topheight",topheight);
var heightdiff = conheight - topheight;
console.log("heightdiff",heightdiff);
var bottext = $("#bottom").html();
console.log(bottext);
if ( bottext.length > heightdiff ) {
console.log("exceeded");
console.log(bottext.length);
}
else {
console.log("within div");
}
I dont have any idea what to write inside if
tag.
This is my fiddle link what i did upto now.
Any help would be appreciated.