473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

The ongoing new-window Resize debate

juglesh <ju*****@nospamRadioKDUG.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.availWidth, screen.availHeight);
}


I like availWidth and availHeight, but I'd much rather work with
window.availWidth and window.availHeight. 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.width: " + window.width + "\n" +
"window.availWidth: " + window.availWidth + "\n" +
"screen.width: " + screen.width + "\n" +
"screen.AvailWidth: " + screen.AvailWidth + "\n" +
"window.innerWidth: " + window.innerWidth + "\n" +
"screen.innerWidth: " + screen.innerWidth + "\n");

What I got was:
window.width: undefined
window.availWidth: undefined
screen.width: 800
screen.availWidth: 800
window.innerWidth: undefined
screen.innerWidth: undefined

If one could place images, columns, etc., on the basis of the browser's
current WINDOW.width rather than screen.availWidth, 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*****@agricoreunited.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.availWidth/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.availWidth,
..availHeight. What I do in my window.open comment is not specify
"width=800,height=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.availWidth, .availHeight, but of subtracting sufficient pixels. If
my variable is filled by "screen.availWidth - 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.net.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.availWidth - 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 5600
David Hayes wrote:
juglesh <ju*****@nospamRadioKDUG.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.availWidth, screen.availHeight);
}

I like availWidth and availHeight, but I'd much rather work with
window.availWidth and window.availHeight. 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.html>

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="javascript:openWindow('blah.html','Popupwind ow',
'scrollbars=yes,resizable=yes,HEIGHT=690,WIDTH=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.com> wrote in message
news:Hk*******************@twister.nyroc.rr.com...
David Hayes wrote:
I like availWidth and availHeight, but I'd much rather work with
window.availWidth and window.availHeight. 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.com> 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.com> wrote in message
news:2c*******************@twister.nyroc.rr.com...
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.innerWidth?window.innerWidth:
document.clientWidth?document.clientWidth:"unknown "

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
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...
3
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...
5
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...
2
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...
1
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,...
3
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. ...
1
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. ...
3
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...
1
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.