![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Yes that IS me. Bitch.
Industry Role:
Join Date: Nov 2001
Posts: 14,149
|
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() ------------------ 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).] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2001
Location: Puerto Del Carmen, Lanzarote, Canary Islands
Posts: 1,572
|
screenX=
screenY= width= height= innerWidth= innerHeight= resizable= alwaysLowered= alwaysRaised= z-lock= dependent= directories= hotkeys= location= menubar= scrollbars= titlebar= toolbar= status= |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Aug 2001
Location: Hiding from you.
Posts: 1,809
|
Just stare at your monitor and hum a jaunty tune...it'll fix itsself.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Registered User
Join Date: Sep 2001
Posts: 16
|
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) } |
![]() |
![]() ![]() ![]() ![]() ![]() |