Detecting Where Text Wraps
If I have a DIV containing a single text node, is there a way to
detect where (or if) the text in that node wraps?
Some text that possibly wraps to a second line.
I'd very much appreciate if someone could point me in the right
direction, or even tell me that it's not likely to be easily
Re: Detecting Where Text Wraps
Jeff Bigham wrote:
> If I have a DIV containing a single text node, is there a way to
> detect where (or if) the text in that node wraps?
> Some text that possibly wraps to a second line.
IE exposes a method getClientRects which you could call on the div
element object and check the length property of the collection returned.
If it is greater than one then there are at least two lines of text in
the div. Each item in the collection is a TextRectangle object with
properties that should allow you to find where the text wraps
An example is here:
I think Firefox 3.0 implements that method too but I have so far not
used it with Firefox so I don't know how compatible the implementations are.
|All times are GMT. The time now is 11:09 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.