Click to See Complete Forum and Search --> : Control Size of DIV, TD or New Window?


TSeroogy
08-25-2003, 12:48 PM
I'm using a variable to control the text that is passed into a DIV, TD and/or a new Window?

How do I set the size parameter such that the size of the DIV, TD or new Window adjusts to the amount of text that is included by the variable.

Example 1:
I open a new blank window using WINDOW.OPEN. The width is set such that it covers 1/3 of the screen, and it is positioned on the right side of the screen.

I fill the new window with text passed from a variable located in the parent window. How can I make sure that the height of the window will adjust to the amount of text that is passed by the variable?

Example 2:
Same scenario as Example 1, only I need to size a DIV object or a Table Cell (TD) instead.

Example 3:
I open a new window using WINDOW.OPEN. The new window includes a table. How can I open the new window making sure that the whole table is visible?

All help is much appreciated.

Best regards,
TSEROOGY

Khalid Ali
08-25-2003, 01:08 PM
here is an idea to increase window size on depending upon the text contents.

Whenever contents of the page grow in size they go out of the main viewable area of the window,that triggers browser to show scrollbars so that you can scroll right or down/up to view the contents.

Now what you want to do is look out for scroll top and left values they are 0 to begin with,but as soon as content go beyond the viewable area its >0 just add that number to window size and
window.resizeTo(x,y)

i am sure it will work..

TSeroogy
08-25-2003, 02:17 PM
Thank you very much, Khalid. Simple and easy solution!

Best regards,
TSEROOGY