[thelist] Chnaging window features on same window

.jeff jeff at members.evolt.org
Wed Jul 25 12:39:39 CDT 2001


flip,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Flip C.
:
: Go here for the code I have so far
: http://worldconspiracy.org/JavaScript/Testpage.htm
: All details of what Im trying to do are on page.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

if you want people to help, get rid of that infernal "no right-click"
script.  read up on why:

http://evolt.org/article/thelist/17/719/

if you mess with my mouse you're going to piss me off.  (besides, it's going
to throw errors on some browsers anyway).

not that that even remotely stopped me from viewing the source, lemme give
you a hand with your question:

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: I have multiple links loading into same window.
: That window stays focused with each new Onclick.
: The thing is I want to be able to change that
: windows features with each new Onclick.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

once a window is opened you can't change its properties.  however, there's
nothing stopping you from closing it if it's open and opening a new instance
of it with different features.

var win = null;

function NewWindow(mypage, myname, w, h)
{
  var settings = 'width=' + w + ',height=' + h + ','
               + 'top=80,left=650,scrollbars';
  if(!win.closed) win.close();
  win = window.open(mypage, myname, settings);
  if(win.focus) win.focus();
}

call it like this:

<a
 href="http://www.worldconspiracy.org/Trucks/Destructo.htm"
 target="trucks"
 onClick="NewWindow(this.href, this.target, '50', '50'); return false"
>Destructo</a>

now non-js browsers can see your content while js-enabled browsers get the
sized popup.

good luck,

.jeff

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






More information about the thelist mailing list