homepage Welcome to WebmasterWorld Guest from 54.242.140.11
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Size and Position Multiple Windows with Javascript
want the windows to fill the screen exactly
mgraso

10+ Year Member



 
Msg#: 223 posted 9:43 pm on Nov 6, 2002 (gmt 0)

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!

 

tedster

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



 
Msg#: 223 posted 11:34 pm on Nov 6, 2002 (gmt 0)

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?

mgraso

10+ Year Member



 
Msg#: 223 posted 3:13 am on Nov 7, 2002 (gmt 0)

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]

tedster

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



 
Msg#: 223 posted 6:01 am on Nov 7, 2002 (gmt 0)

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.

mgraso

10+ Year Member



 
Msg#: 223 posted 9:41 pm on Nov 7, 2002 (gmt 0)

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"!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved