Webskater
01-30-2003, 11:30 AM
Is there a way of telling a new window (window.open) to open in the centre of the screen? Thanks.
|
Click to See Complete Forum and Search --> : Window position Webskater 01-30-2003, 11:30 AM Is there a way of telling a new window (window.open) to open in the centre of the screen? Thanks. swon 01-30-2003, 11:53 AM Try this one: ----------------------------------------------------------------------- <script language="JavaScript"> <!-- function winopens() { winwidth=300; // width of window winheight=300; // height of window var w=window.open('tests.html','MyWin','width='+winwidth+',height='+winheight); w.moveTo(screen.availWidth/2-(winwidth/2),screen.availHeight/2-(winheight/2)) } //--> </script> <body onLoad=winopens()> Webskater 01-30-2003, 12:18 PM Thanks, swon. That worked perfectly - but then you knew that already. Cheers. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |