[thelist] Another Pop-up Question

.jeff jeff at members.evolt.org
Sat Nov 17 18:16:24 CST 2001


sandy,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: iibiz
>
> Using the following pop-up:
>
> <A
>  HREF="hi_altitude_jacketlg.html"
>  onClick="window.open('hi_altitude_jacketlg.html'
>                      ,'hi_altitude_jacket'
>                      ,'height=490,width=500');
>                      return false;"
>  CLASS="pop"
>  style="text-decoration: none">
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

do as richard suggested and add "top=0,left=0" to the third argument of the
open() method.  to get this to work in as many browsers as support the popup
placement capability, may i suggest that you also include
"screenX=0,screenY=0".  this is necessary for some versions of nn4.  that
means you'll be adding "top=0,left=0,screenX=0,screenY=0" to each of the
window.open() calls.

i'm happy to see that you're trying to make your imagery accessible to the
non-javascript crowd as well.  i'd like to make a suggestion to make your
coding and maintenance alittle easier.  rather than typing the path twice,
use the this keyword combined with the href property within your open()
method as the first argument rather than hardcoding it.  this way you need
only change the value of your href attribute and the correct document will
still be opened in the popup.  like so:

<a
 href="hi_altitude_jacketlg.html"
 onclick="window.open(this.href
                     ,'hi_altitude_jacket'
                     ,'height=490,width=500');
                     return false;"
 class="pop"
 style="text-decoration: none">

additionally, you can have non-js browsers open the image up in a new window
(albeit it not a js popup) by using the target attribute.  you can also use
the this keyword and the target property as the second argument of the
open() method reducing your typing as well.  like so:

<a
 href="hi_altitude_jacketlg.html"
 target="hi_altitude_jacket"
 onclick="window.open(this.href
                     ,this.target
                     ,'height=490,width=500');
                     return false;"
 class="pop"
 style="text-decoration: none">

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list