Help - Search - Members - Calendar
Full Version: Can any one suggest the CSS/Script for thsi problem
HTMLHelp Forums > Programming > Client-side Scripting
venkat_walking
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
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
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.