Welcome to WebmasterWorld Guest from 54.205.170.21

Forum Moderators: open

Message Too Old, No Replies

Size and Position Multiple Windows with Javascript

want the windows to fill the screen exactly

   
9:43 pm on Nov 6, 2002 (gmt 0)

10+ Year Member



Hi, i need to open multiple windows(4)
These windows must open with click on one button and fit in screen of viewer(640x480,800x600,1024x768...)
i know one way to do this, but it's so long(70 lines), i wanna learn best way to do it.
Help me!
Thanks!
11:34 pm on Nov 6, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Do you mean FILL the screen at any resolution, thereby splitting the screen into four quadrants-- or just "fit" the windows all in visibly, even if unused space remains or overlapping occurs?
3:13 am on Nov 7, 2002 (gmt 0)

10+ Year Member



I mean fill the screen at any resolution with four or more windows.(windows must hide the screen)
(maybe with for loops)
Sorry for my bad English!
[12]
[34]
6:01 am on Nov 7, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You will first want to code some javascript to capture availHeight and availWidth for the screen object. Store those two values as variables and then use calculations to work out your window dimensions and positions.

That doesn't sound like it should take 70 lines of code to me - unless you're not sure up front how many windows you need total. You originally said four windows, but now I see you've added the "or more". That may be a complication and the code for this approach might easily swell to 70 lines.

Is it important that the user be able to move these windows around independently? If it isn't, you may do better with iframes, or a regular frameset, or even 4 divs with overflow set to scroll.

9:41 pm on Nov 7, 2002 (gmt 0)

10+ Year Member



Look, i wrote the code for four windows and it take 50-60 lines(depend on spaces).I just want to know is there some shortcut. Can i do this with loop and how?

--help "young webmaster"--
to become "old webmaster"!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month