venkat_walking
Aug 10 2009, 03:27 PM
Hello Friends,
Say, I am having a <DIV > of Width=100 and Height 100.
Now I want to insert some text (words ranging from 4 char - 8 char) in to that <DIV> as innerHTML , words would be separated by a SPACE.
Total characters in a DIV innerHTML would range from 0-80;
The point and need is that, The word i.e the contents should get
* wrapped , automatically
* Resized autimatically to fit in the div. No matter how small it goes. (But It would have a max size limit).
I know java script will come in the play.
Any suggestion would be very helpful
Thanks,
Venkat
Christian J
Aug 12 2009, 08:46 AM
Maybe you could check if the DIV's scrollHeight is larger than its clientHeight (that should happen when a scrollbar is created in a DIV styled with 'overflow: auto'), which means the text must be made smaller, but it sounds complicated and bug-prone.
venkat_walking
Aug 13 2009, 05:10 AM
QUOTE(Christian J @ Aug 12 2009, 08:46 AM)

Maybe you could check if the DIV's scrollHeight is larger than its clientHeight (that should happen when a scrollbar is created in a DIV styled with 'overflow: auto'), which means the text must be made smaller, but it sounds complicated and bug-prone.
Ok i will check it out and get it to you
Thanks
Venkat