noidtluom Posted October 5, 2007 Share Posted October 5, 2007 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 More sharing options...
fenway Posted October 7, 2007 Share Posted October 7, 2007 I'm confused... just use clientWidth and clientHeight. Link to comment https://forums.phpfreaks.com/topic/71980-popup-in-center-of-screen-problem/#findComment-364044 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.