PDA

View Full Version : simple popup question


stvchez
12-19-2002, 02:54 AM
I am having a tough time trying to get this popup to work with the location=yes

1. This works as it should
<a href="read_yahoo.aspx" onclick="NewWindow(this.href,'name','500','500','yes');return false;"> // the window pops up

2. When I put in the location=yes, no window popup at all, like the javascript gets inactive...

<a href="read_yahoo.aspx" onclick="NewWindow(this.href,'name',location=yes,'500','500','yes');return false;">

basically i just need the URL bar within my popup window. thanks

glenngv
12-19-2002, 03:03 AM
what's in NewWindow() function?

stvchez
12-19-2002, 03:07 AM
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

glenngv
12-19-2002, 03:13 AM
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',location=1,scrollbars='+scroll+',resizable=1';
win = window.open(mypage, myname, winprops)
win.focus();
}

<a href="read_yahoo.aspx" onclick="NewWindow(this.href,'name','500','500',1);return false;">

you can pass 'yes' or 1 to the scroll parameter

stvchez
12-19-2002, 04:03 AM
works like charm. thanks a million!