"Andrew Poulos" <ap*****@hotmail.com> wrote in message
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
Say I have a text area. When the user clicks a button the entered text
displays in a DIV. If there's too much text to fit in that DIV then the
overflow text (the text that doesn't fit in the first DIV) displays in
an adjacent DIV.
Is there a way to know if there's "overflowing" text and, if there is,
if there a way to know what that text is?
Not really, at least none that I've heard of, but there are various ways to
hack it.
One way would be to have two or more copies of the text inside clipping
elements.
The 1st element has the text positioned at the top, the 2nd has the text
positioned above the top of the clipping element by the same value as the
height of the 1st element.
I've used 'px' for the size and position rather than 'em' so you can change
the font size and see the apparent reflowing of text into the 2nd box. It's
a quick lash-up but seems to work.
eg:
<!-- FIRST BOX -->
<div style="overflow:hidden; width:200px; height:400px; position:absolute;
top:0; left:0">
<p style="position:relative; top:0"> --- placeholder text --- </p>
</div>
<!-- OVERFLOW BOX -->
<div style="overflow:hidden; width:200px; height:400px; position:absolute;
top:0; left:200px">
<p style="position:relative; top:-400px"> --- placeholder text --- </p>
</div>