Jump to content

Popup in center of screen problem.


noidtluom

Recommended Posts

Hello all, I'm terrible at javascript, and I've hardly ever used it before.

 

I'm trying to make a popup appear at the center of the page, and this is what I have so far:

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function popUp(URL) {

day = new Date();

id = day.getTime();

 

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=<? echo "$width"?>,height=<? echo "$height"?>,left=500,top=' + ((screen.height - height) / 2) : ');");

}

// End -->

</script>

 

That's the code for the javascript function, can you see if you can find anything wrong with it?

(Note: the code to call the function seems to be fine)

Link to comment
https://forums.phpfreaks.com/topic/71980-popup-in-center-of-screen-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.