GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Centering Pop Up Java Script Question (https://gfy.com/showthread.php?t=45328)

spacedog 01-03-2002 12:48 PM

Centering Pop Up Java Script Question
 
Hi..
Can some one help me with this code?

The code works & functions fine, but I'd like the window to be in the center of the screen..What should I do?

Here's the code..

Code:

function openpopup(){
var popurl="eraser.htm"
winpops=window.open(popurl,"","width=450,height=140,")
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
        end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
  }
  return returnvalue;
}

function loadornot(){
if (get_cookie('poppedup')==''){
openpopup()
document.cookie="poppedup=yes"
}
}

loadornot()

Thanks

------------------
My Galleries suck, so please submit yours

I'm Fucking Starving..Sign Up for My Sponsors..

[This message has been edited by spacedog (edited 01-03-2002).]

Dopy 01-03-2002 03:52 PM

screenX=
screenY=
width=
height=
innerWidth=
innerHeight=
resizable=
alwaysLowered=
alwaysRaised=
z-lock=
dependent=
directories=
hotkeys=
location=
menubar=
scrollbars=
titlebar=
toolbar=
status=

Squishy 01-03-2002 03:53 PM

Just stare at your monitor and hum a jaunty tune...it'll fix itsself.

sw 01-03-2002 06:44 PM

Just change the openpopup() function with this one:
Code:

function openpopup()
{
x=450
y=140
l=(screen.availWidth/2)-(x/2)
t=(screen.availHeight/2)-(y/2)
var popurl="eraser.htm"
features="width="+x+",height="+y+",status=no,toolbar=no,menubar=no,resizable=no,left="+l+",top="+t
winpops=window.open(popurl,"",features)
}

You can change to "status=yes", "toolbar=yes" etc


All times are GMT -7. The time now is 07:26 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123