View Full Version : I need a popup that will work consistently

06-04-2004, 09:34 PM
I am using a javascript to open a popup window from a link:

<!-- Begin
function openpopup(){
var popurl="http://nancyslaneinteriordesign.com/main.htm"
// End -->

<a href="javascript:openpopup()">

I just want it to pop up in the top left hand corner, but it pops up in different places on different computers. Where can I find a javascript that will be consistant on all broswers and computers?

06-04-2004, 09:59 PM
Hi there pacothelovetaco,

and a warm welcome ti these forums :D

Add top=0,left=0, to this line thus.....


....then adjust these values to suit your needs :D


06-04-2004, 11:33 PM
First off thank you for the welcome. It was much appreciated. Second thank you for you help. That is all I needed.

06-07-2004, 07:31 AM
You may want to make the function more generic so you can use it in multiple links.

function openpopup(popurl){
var winpop=window.open(popurl,"","width=990,height=486,top=0,left=0");
return false; //cancels href
<a href="main.htm" onclick="return openpopup(this.href)">main</a>
<a href="sub.htm" onclick="return openpopup(this.href)">sub</a>

Doing it this way enables your page to still be opened even if javascript is disabled.