Re: popup window
by "Kehvan M. Zydhek" <kehvan(at)zydhek.net>
|
Date: |
Wed, 26 Apr 2000 01:19:54 -0700 |
To: |
<Reywob(at)aol.com>, <hwg-techniques(at)hwg.org> |
References: |
aol |
|
todo: View
Thread,
Original
|
|
Peter,
A common popup script I use, in conjunction with a standard hypertext link,
is:
swidth=screen.width
if (swidth < 800) {
var www="400";
var hhh="300";
var sbs="yes";
}
if (swidth >= 800) {
var www="700";
var hhh="500";
var sbs="no";
}
function popUp(pPage) {
popUpWin = window.open(pPage,'popWin','resizable=yes,scrollbars=' + sbs
+ ',width=' + www + ',height=' + hhh);
}
This script's variables open either a fixed-size popup for 800x600 and
higher resolutions, or a smaller, scrollable popup for smaller resolutions.
In either case, the resulting popup window is resizable by the user. The
variables are fairly self-explanitory. You can choose to remove the
variables and set a fixed size by removing the ' + www + ' (replacing it
with your desired width) and ' + hhh (replacing it with your desired height
and a closing ' ). The ' + sbs + ' can be set to either yes or no, depending
on whether you want scrollbars or not.
This script is invoked with the following line:
<A HREF="javascript:popUp('[Linked page]')">[Linked text or image here]</A>
...and the standard, non-JavaScript code below or beside it (depending on
your layout):
<A HREF="[Linked page]" TARGET="_blank">[Linked text or image here]</A>
I use this script on one of my client's sites, where the popup function is
wrapped around an image tag, and the standard link is wrapped around the
image's caption. I then include a comment on the page stating that the
images call the popup (using JavaScript), and the captions open a new window
(without JavaScript).
Hope this helps! Good luck!
Kehvan M. Zydhek
----- Original Message -----
From: <Reywob(at)aol.com>
To: <hwg-techniques(at)hwg.org>
Sent: Tuesday, April 25, 2000 11:56 PM
Subject: popup window
> Hi,
>
> Does anyone know of a script to launch a popup window, where the link will
> still work even if the visitor doesn't hava javascript enabled?
>
> Thanks
> Peter.
>
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA