Click to See Complete Forum and Search --> : Centered pop in Netscape 7.02


manu
07-21-2003, 05:26 AM
Hi all,

I have a little problem and don't know how to solve it:
I want to open a popup when the user clicks on a link. It works fine with IE, but NS opens the popup in fullscreen mode... I don't understand!!!

And I used a sample code I found on JavaScriptSource: the sample code works fine with both IE & NS on the JSSource site, but not on mine.

Here is the code I use:

function openContent(theLink) {
var theLeft = 150;
var theTop = 150;
var theWidth = screen.width - 300;
var theHeight = screen.height - 300;
var windowParameters = 'toolbar = yes, location = yes, directories = no, status = no, menubar = no, scrollbars = yes,resizable = yes, width = ' + theWidth + ', height = ' + theHeight + ', left = ' + theLeft + ', top = ' + theTop + ', resizable';
var scriptParameters = "linkdet.php?id=" + theLink;
filesWindow = window.open("", "Link", windowParameters);
filesWindow.close();
filesWindow = window.open(scriptParameters, "Link", windowParameters);
}

and the link I use looks like this:

<a href="links.php" onClick="openContent('6da1543a64');return false" class="LienFicheMin">[more]</a>

The parameter I use in the openContent() function is a db resource id I use in the linkdet.php script to retrieve data.

The page can be seen at http://www.eurotra.belbone.be/links.php

Can somebody help me???

gil davis
07-21-2003, 07:08 AM
var windowParameters = 'toolbar = yes, location = yes, directories = no, status = no, menubar = no, scrollbars = yes,resizable = yes, width = ' + theWidth + ', height = ' + theHeight + ', left = ' + theLeft + ', top = ' + theTop + ', resizable';Netscape does not like whitespace in the features string. Try this:
var windowParameters = 'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='
+ theWidth + ',height=' + theHeight + ',left=' + theLeft + ',top=' + theTop;

manu
07-21-2003, 07:53 AM
Thanks a lot: it works OK!!!

And I'll remember it for my future scripts!