PDA

View Full Version : popup


doubleT
09-28-2002, 11:49 PM
<script>
var doPopUpX = (screen.width/2)-800;
var doPopUpY = (screen.height/2)-400;
var pos = "left="+doPopUpX+",top="+doPopUpY;
function doPopUp(){
doPopUpWindow = window.open("http://a.com/abc.html","ABC","width=600,height=800,"+pos);
}
</script>


Hey people, that a popup window when I click a link, but I can't make it a whole screen. how do I make it to fit the screen. Like center and then fit the whole screen? :confused:

jamescover
09-29-2002, 01:39 AM
For centering, I've always used (screen.width-width)/2.
So, for a 400x400 popup, you'd get left=200, top=100.


Like so:

<script>
width=800;
height=600;
var doPopUpX = ((screen.width-width)/2);
var doPopUpY = ((screen.height-height)/2);
var pos = "left="+doPopUpX+",top="+doPopUpY;
function doPopUp(){
doPopUpWindow = window.open("http://a.com/abc.html","ABC","width=800,height=600,"+pos);
}
doPopUp();
</script>



james
He is risen!!!

adios
09-29-2002, 03:31 AM
http://www.webreference.com/js/tutorial1/utilize.html

doubleT
10-02-2002, 05:36 AM
<script>
width=800;
height=600;
var doPopUpX = ((screen.width-width)/2);
var doPopUpY = ((screen.height-height)/2);
var pos = "left="+doPopUpX+",top="+doPopUpY;
function doPopUp(){
doPopUpWindow = window.open("http://a.html","A","width=780,height=520,"+pos);
}
</script>

How do Make the that popup window have autoscroll? autoscroll=yes doesn't work

glenngv
10-02-2002, 06:50 AM
do you mean

scrollbars=yes

?