Friday, 15 March 2013

javascript - How can you tell when a <div> is full of text? -


Imagine a website with an element that the site wants to run some JS that fill the div with random text When div should complete it and it should start. Yes, I know that sounds strange but the question is when does J.S. know when the completion is complete, and will the overflow start?

By 'complete', I mean that now more text can not be kept. Div I think this is a point, a scroll bar will be enabled / visible.

What you can do is actually text in an internal div, with a fixed width of the container But there is no definite height, then allow you to grow the internal content with your content, and check that its height is at the height of the parent


No comments:

Post a Comment