[WEB4LIB] Re: Netscape New Window size
Thomas Dowling
tdowling at ohiolink.edu
Mon Jul 31 08:41:40 EDT 2000
[Insert standard caveats about why and when to open new windows at all.]
To answer the original question, 'target="_blank"' will not take any
sizes for the new window.
> ...this is the link that calls up the function
>
> <a href="javascript:openinf('http://www.whatever.com', 'title
of new window')">
>
> for more information try one of the following sites, though there are
of course others:
>
> http://webreference.com
> http://www.javascript.com
> http://www.webcoder.com
> http://www.webmonkey.com
>
Here's a rebuttal:
http://www.w3.org/TR/1999/WAI-WEBCONTENT-19990505/#gl-new-technologies
The problem with this approach is that it absolutely breaks the link for
anyone working without JavaScript. It's less likely to cause
accessibility problems if client-side scripting is used to tweak
standard links. You could try something like this:
=========
<script type="text/javascript"><!--
function openWin() {
newWin =
window.open("","MyNewWindow","menubar=yes,scrollbars=yes,toolbar=yes,res
izable=yes,width=300,height=300");
}
</script>
<a href="http://www.yahoo.com"
target="MyNewWindow"
onClick="openWin()">Yahoo in an explicitly sized window.</a>
=========
With a little experimentation with screen.width and screen.height (see
<URL:http://www.javascripter.net/faq/screensi.htm> for example), you
could set the new window's dimensions to a percentage of the screen
size, which is probably more useful today than just picking pixel
dimensions.
Thomas ("When the only tool you have is a hammer,
every problem looks like a thumb") Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu
More information about the Web4lib
mailing list