473,545 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The ongoing new-window Resize debate

juglesh <ju*****@nospam RadioKDUG.com> wrote in "Re: how to maximize the
browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12
AM):
[...]
I want to maximize the browser window when I open a new window.[...]
function expand() {
window.moveTo(0 ,0);
window.resizeTo (screen.availWi dth, screen.availHei ght);
}


I like availWidth and availHeight, but I'd much rather work with
window.availWid th and window.availHei ght. Unfortunately, they just aren't
universally available. When I ran a function to see which ones were
available, most weren't. I tried:

alert("window.w idth: " + window.width + "\n" +
"window.availWi dth: " + window.availWid th + "\n" +
"screen.wid th: " + screen.width + "\n" +
"screen.AvailWi dth: " + screen.AvailWid th + "\n" +
"window.innerWi dth: " + window.innerWid th + "\n" +
"screen.innerWi dth: " + screen.innerWid th + "\n");

What I got was:
window.width: undefined
window.availWid th: undefined
screen.width: 800
screen.availWid th: 800
window.innerWid th: undefined
screen.innerWid th: undefined

If one could place images, columns, etc., on the basis of the browser's
current WINDOW.width rather than screen.availWid th, everyone could be happy.
Yet, having as I do Internet Explorer 5.5 (and Netscape 4.6) (this isn't an
exhaustive list: this is what I use for most tests), running on Windows ME,
I can say that whatever problems I brought on myself by not having the most
up-to-date versions, I'm at least replicating the conditions of a multitude
of potential visitors, so many of whom haven't upgraded in recent years
either.

Grant Wagner <gw*****@agrico reunited.com> responded (Thursday, January 06,
2005 1:53 PM): [after quoting above code:]
- Does not do anything in Gecko-based browsers appropriately configured
- Results in an MDI window that is both too tall and too wide in Opera
7.54u1
- Results in a window that is actually wider and taller than
screen.availWid th/Height in Netscape 4 (because resizeTo() resizes the
window's viewport, not it's outter dimensions)
- Annoys the user when it does work, since they probably had their
browser the size they wanted it
Noozer" concurred (Saturday, January 01, 2005 12:59 AM): 1) Don't touch my browser size. I'm quite capable of resizing the window if I need to.

2) Don't open a new window. Your site has a browser window, ONE is all you
get. Make good use of it.
So did Sid Ismail (Saturday, January 01, 2005 7:53 AM): Don't open a new window. Don't maximise. Do not pass Go.

It's _my_ browser.
There are valid concerns here, but they can be overcome. One window is not
the ideal for some material when the user knows that the content of the new
window is just a side point and that he likely will return to the first
page. Think of the sites where you are invited to read a disclaimer, an
explanation, a definition or a chart (perhaps shipping charges). Do you
really want the new page to stay within the same window, with it coming with
the worry that the form you may have filled out (radio buttons for a survey,
street address for mail delivery of documentation, etc.) may be blank when
you return to this page? Pop-ups eliminate this worry, because the content
of the first window stays as it is until one returns and deliberately
effects a change.

(There's a lot to be said here for putting a note next to the link on the
first page: "will appear in a new window.")

I take it to be a responsibility that I not abuse screen.availWid th,
..availHeight. What I do in my window.open comment is not specify
"width=800,heig ht=600" but use variables for the width and height of the new
window. And these variables are filled not by merely the results of getting
screen.availWid th, .availHeight, but of subtracting sufficient pixels. If
my variable is filled by "screen.availWi dth - 90," I know that I am leaving
sufficient space at the bottom of the screen for the user to see his
taskbar. (I take it for granted that I also use "window.moveTo( 0,0)" so
that buffer space at the top and left of the new browser window doesn't
crowd the bottom and right sides off the screen.)

Fred Oz <oz****@iinet.n et.auau> brought up another point (Saturday, January
01, 2005 5:43 AM) [...] users were so pissed
off with windows opening full screen that browser makers removed the
ability for programmers to do it. Many browsers also allow the user to
stop JavaScript from resizing or moving windows.

New windows, by default in most browsers, open to the same size as the
current window. So users with full-screen windows will not notice you
setting your new window to full screen, whereas those with their
browsers set smaller will. Consider someone with a large monitor of
say 2560x1600. Or maybe with one desktop spread over two monitors. Do
you really think they want your window over their entire desktop?
Here, too, a responsible programmer doesn't let "screen.availWi dth - 90"
(and its availHeight counterpart) end his settings. By setting a maximum
for the variable (if screenHght > 1200 {screenHght == 1200}), one doesn't
force these problems on the user. Quite apart from the problem of a desktop
spread over two monitors, it's just common sense that text becomes difficult
to read when the lines are too wide. Never mind that the user doesn't have
to scroll left and right -- if the line is so wide on a two-foot-wide screen
that the reader needs a straight edge sheet of paper to help him keep his
place, then the programmer has done a disservice.

Grant Wagner knew of that from his own experience when he wrote (Tuesday,
September 21, 2004 1:32 PM)(in "Re: resize browser window on load"): [...] I was recently forced to work on a laptop with a 640 x 480 display. I can not tell you how hostile most sites I visited were to that particular
resolution, let alone something smaller that you might find on a portable
device.
I know too from my own business travels what it was like to regularly work
(and have after-hours leisure) with a laptop with a 640 x 480 screen. One
has to wonder who the programmers thought they were pleasing with attractive
designs that were disfunctional. Sometimes if it wasn't just for a header
..GIF that spread past the edge of the screen (when the scroller wasn't set
for the right side), the ASCII text wouldn't have been an obstacle course of
constantly scrolling left and right.

W.H. Olives offered a solution to the problem of placement in "Re: resize
browser window on load" (Tuesday, September 21, 2004 12:50 PM): I always start a new page and insert a 75% width table, aligned to center.
I then insert a 100% table with 2 columns (right margin) and a few rows,
into that one.

This is exactly how YAHOO and GOOGLE's pages Load, like they'll fit anything they encounter. I will never go back to all of that "detect browser/detect resolution crap. Thank God for % width tables.
I agree. I have achieved what I wanted in screen placement through a
judicious use of a mix of tables, including embedded tables.

arkascha wrote in "window resize to required size" (Wednesday, October 20,
2004 9:24 AM) [...] When choosing a fixed window size things look
silly most of the time. Either you have a nearly
empty window or you have to scroll all the time...

So I want to resize the window. Resize it to what size? The size that is
required by the pages content when redered in the browser. That's all :-)

-- hmmm -- I tried around quite a lot with scrollHeigths, offsetWidth and so on, but there does not seem to be any more or less reliable solution.,
Especially not when trying to make stuff usable for different browsers.
Does anyone have a hint what else I can try, where I could look?


As long as it will be the case that programmers are presenting images --
which are almost by definition of fixed size (let's not think of how
gruesome they look when they're blown up to fit an arbitrary amount of
space) -- there is going to be the problem of blank space beyond which the
designer chose not to place additional photographs lest the page become a
scrolling nightmare on a 640-width monitor. (I use pop-ups for picture-rich
pages for this reason, but set the width at no more than about 550, but
often at less than that.)

Summary statement: can JavaScript programmers accept judicious and
responsible use of launching new windows and setting browser width?

--
David Hayes

(remove the name of the programming language from email address to make it
usable)




Jul 23 '05 #1
6 5621
David Hayes wrote:
juglesh <ju*****@nospam RadioKDUG.com> wrote in "Re: how to maximize the
browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12
AM):
[...]
I want to maximize the browser window when I open a new window.[...]


function expand() {
window.moveTo (0,0);
window.resize To(screen.avail Width, screen.availHei ght);
}

I like availWidth and availHeight, but I'd much rather work with
window.availWid th and window.availHei ght. Unfortunately, they just aren't
universally available. When I ran a function to see which ones were


Window size != screen size.
Mick
Jul 23 '05 #2
David Hayes wrote:
[...]
Summary statement: can JavaScript programmers accept judicious and
responsible use of launching new windows and setting browser width?


Limited and judicious use of pop-ups is OK for specialty sites like
galleries, but web sites should be designed first and foremost to
operate without any JavaScript or popups. JS should enhance the
experience, not be the experience unless that is an express or closely
related purpose of the site (say browser games). In all other cases,
web pages must cater for users with JavaScript disabled and users with
browsers that don't support it.

Attempting to ensure your pop-up is reasonably sized is also a good
idea - for assistance with your cross-browser issues, try:

<URL:http://www.quirksmode. org/index.html?/viewport/compatibility.h tml>

As for returning to a partially completed form, the flow of the site
should be such that users don't have to leave a partially completed
form to read a disclaimer or other important information. The
corollary is that users don't always close the extra windows, they just
click back on the main window (particularly users who surf with
full-screen windows). The plethora of background popups that are
likely to result can become a serious drain performance.

Finally, have had the ability to open links in a new window themselves
from the very early days. The "Back" button also helps here. Further,
the increasing use of tabs makes pop-ups irrelevant. If users know
that they are clicking on a "more information" link, they can choose to
open it in a tab or a new window, then close it or keep it available
for further reference.

An example of a really bad pop-up is:

<A href="javascrip t:openWindow('b lah.html','Popu pwindow',
'scrollbars=yes ,resizable=yes, HEIGHT=690,WIDT H=800,')">Blah page</A>

It prevents users even having the choice - this 'link' will either open
in a new window under the programmers control, or not at all. If a
user attempts to open it in a tab or new window, they'll perhaps get an
error message, or more likely nothing at all will happen.

--
Fred
Jul 23 '05 #3
"Mick White" <mw***********@ rochester.rr.co m> wrote in message
news:Hk******** ***********@twi ster.nyroc.rr.c om...
David Hayes wrote:
I like availWidth and availHeight, but I'd much rather work with
window.availWid th and window.availHei ght. Unfortunately, they just aren't universally available. When I ran a function to see which ones were


Window size != screen size.
Mick


I know that window size doesn't equal screen size. What I would like would
be to set the design of the inner space of the browser on the basis of the
window size. If I could, the new window (or the new page within the same
window) would be the same dimensions as the window that the user already is
looking at. This would satisfy the user who has determined how much of his
screen he wants to allot to the browser and doesn't care to see the link
take him to a page that uses a larger or smaller portion of the desktop.

--
David Hayes

(remove the name of the programming language from email address to make it
usable)
Jul 23 '05 #4
David Hayes wrote:
"Mick White" <mw***********@ rochester.rr.co m> wrote in message

Window size != screen size.
Mick

I know that window size doesn't equal screen size. What I would like would
be to set the design of the inner space of the browser on the basis of the
window size. If I could, the new window (or the new page within the same
window) would be the same dimensions as the window that the user already is
looking at.


This is default behaviour, no need for js to manipulate new window.
Mick

....snip
Jul 23 '05 #5
"Mick White" <mw***********@ rochester.rr.co m> wrote in message
news:2c******** ***********@twi ster.nyroc.rr.c om...
David Hayes wrote:
[...]
I know that window size doesn't equal screen size. What I would like would be to set the design of the inner space of the browser on the basis of the window size. If I could, the new window (or the new page within the same window) would be the same dimensions as the window that the user already is looking at.


This is default behaviour, no need for js to manipulate new window.


There's no need to manipulate JavaScript to establish that the new window
will be the same size as the previous -- BUT THERE would be a benefit to
using the browser window's actual width (as opposed to screen width) to
position images mid-screen, set graphics to appear directly above columns
set to fill particular dimensions, etc. Sure, tables are wonderful to
positioning things at particular percentages and a given number of pixels,
but sometimes this is not enough. The context in which the desire of mine
was first mentioned, that being in the first message on this thread --
wherein I spoke before about tables and screen locations, and quoted from
another person who wrote on this subject in this newsgroup -- should suggest
the scope which should be considered when one responds with a rejoinder,
piece of advice, recommendation or suggestion that the person seeking a
JavaScript doesn't know enough about defaults outside of JS.

--
David Hayes

(remove the name of the programming language from email address to make it
usable)

Jul 23 '05 #6
David Hayes wrote:

There's no need to manipulate JavaScript to establish that the new window
will be the same size as the previous -- BUT THERE would be a benefit to
using the browser window's actual width (as opposed to screen width) to
position images mid-screen, set graphics to appear directly above columns
set to fill particular dimensions, etc. Sure, tables are wonderful to
positioning things at particular percentages and a given number of pixels,
but sometimes this is not enough. The context in which the desire of mine
was first mentioned, that being in the first message on this thread --
wherein I spoke before about tables and screen locations, and quoted from
another person who wrote on this subject in this newsgroup -- should suggest
the scope which should be considered when one responds with a rejoinder,
piece of advice, recommendation or suggestion that the person seeking a
JavaScript doesn't know enough about defaults outside of JS.

var windowWidth= window.innerWid th?window.inner Width:
document.client Width?document. clientWidth:"un known"

Note that IE determines window size after all content is loaded. And I'm
not 100% sure of references.

Mick
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3832
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. In fact there are quite a few things that I learned that I did not know before. For example, while I knew that the new and delete operators can be overloaded...
3
9364
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. I am presenting below a summary of what I have gathered. I would appreciate if someone could point out to something that is specific to Borland C++ and is not...
5
5220
by: | last post by:
Hi all, I've been using C++ for quite a while now and I've come to the point where I need to overload new and delete inorder to track memory and probably some profiling stuff too. I know that discussions of new and delete is a pretty damn involved process but I'll try to stick to the main information I'm looking for currently. I've searched...
2
2073
by: Dave | last post by:
Hello all, I'd like to find a source on the web that discusses, in a comprehensive manner and in one place, everything about new / delete. It should include overloading operator new, the new operator, placement, nothrow, arrays, etc... My books cover the topic, I've found FAQs on the web that cover the topic, and so on, but all the...
1
1336
by: Rock | last post by:
Hi, I have been asked to create a web site for a new small budget magazine. This is my business and have been doing it for 8 years but with a web site project with a certian amount of pages, upload and finish. This one goes on and on.. Initallialy it will have 10 pages, then over a period of a month have 50
3
2536
by: mal_lori | last post by:
Hello, I have an ongoing problem with a single machine not recognizing the REPLACE function. This is a WinXP Pro machine, running Office 2000 (SP3) with MDAC 2.8 (SR1) and Jet 4 installed. The references are all identical to every other machine running this app.
1
14396
by: Sharon | last post by:
I'm writing to a file using StreamWriter. I need to know after every file writing, the file size. I do Flush after each line. The FileInfo.Length should retune the file size, but it does not. Here is what I'm doing: StreamWriter myFile = File.AppendText(fileName); myFile .Flush();
3
1204
by: Michelle | last post by:
Hi... Please forgive the slightly less than focussed post, but I couldn't find another place to post this question... this is an open question to people who do software and/or Enterprise Architecture. I think I'm new to SOA and architecture-- but I seem to have been doing it for a while. I'm wondering how a person should be documenting...
1
1027
by: =?Utf-8?B?QXJuZSBCZXJ1bGRzZW4=?= | last post by:
I'm relatively new to vb.net (2005) and I continually experience an out of memory exception during the development process...and this is becoming a big pain!! I have 2gigs of memory and this never happened in vb6. Is there something I can do to fix this? Thanks
2
1421
by: Lilith | last post by:
I'm wondering if C#/.Net would have provisions for the followng. I have an outside application that generates a text file ongoing. I'd like to be able to open the file and read it into a stream that updates/appends whenever something is added to the end of the file. Ultimately I want to scan the file/stream as it's built for indications of...
0
7467
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7807
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7419
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.