Click to See Complete Forum and Search --> : need addtional code to center and size


donbmjr
12-19-2002, 02:02 PM
This script would do well for another part of my site if I could get
it to adjust the windows to different sizes and put them in the center of the window

Thanks
Don

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function leapto(form) {
var uid = new Date().getTime(); // unique ID to name popup
var myindex=form.dest.selectedIndex; // number of selection
str = new String(form.dest.options[myindex].value); // value of selection
strarray = str.split(/\,/); // splits value on a comma

if (strarray[0] == "frame") // loads in frames
parent.right.location.href = strarray[1];
else // load in popup window
window.open(strarray[1], uid, "toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0");
myindex = 0; // reset pulldown menu
}
// End -->
</SCRIPT>



<BODY>

<!-- Configure each item as a popup or frame item using the examples below -->
<CENTER>
<FORM NAME="myform">
<SELECT NAME="dest" SIZE=1>
<OPTION VALUE="popup,http://" SELECTED>Charts
<OPTION VALUE="popup,http://">2002 Finishes
<OPTION VALUE="popup,http://">All Time Wins
<OPTION VALUE="popup,http://">Active Driver Wins
<OPTION VALUE="popup,http://">Cartoons
<OPTION VALUE="popup,http://">Best Average Finish Last 5 Years
</SELECT>
<INPUT TYPE="BUTTON" VALUE="Go" onClick="leapto(this.form)">
</FORM>
</CENTER>

<!-- Script Size: 1.71 KB -->

khalidali63
12-19-2002, 04:00 PM
Quickes solution comes to mind is this.

Create script that gets the screen width and hieght,
then positions the parent window to the centre of the screen.

once that is done,import that position.js( may be) file to all of the pop windows,this will make sure that whenever a pop is opened it will positionitself in the middle..

:-);

cheers

Khalid