Hi all,
First of all I'm new to this Javascript game. Secondly, thanks in advance for reading this.
Essentially what I want to do is to open up a new window from my menu_array.js - not only a new window but a pre-determined sized window in the middle of the users screen. I have achieved this before with html code calling upon the script below
//Pop up style windows will always open in the middle of the users screen
function NewWindow(mypage,myname,w,h,scroll)
{
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',lef
t='+LeftPosition+',scrollbars='+scroll+',resizable
'
win = window.open(mypage,myname,settings)
}
Then by calling upon it from the html like so
href="mypage.htm" onclick="NewWindow(this.href, 'name' , '500' , '420', 'no'); return false"
But I cannot for the life of me fathom out how to do this from a menu_array.js file
My menu_array is working fine to a degree but all pages accessed via the menu all appear in the same window. I've hunted around and looked at other sites using a menu_array and noticed that they're the same. Maybe I'm not looking hard enough.
I could go back and use an html form but I think the javascript array looks much, much better,
I hope I've made myself clear. Thank you once again for reading. Any help would be much appreciated
From a Javascript Noob
First of all I'm new to this Javascript game. Secondly, thanks in advance for reading this.
Essentially what I want to do is to open up a new window from my menu_array.js - not only a new window but a pre-determined sized window in the middle of the users screen. I have achieved this before with html code calling upon the script below
//Pop up style windows will always open in the middle of the users screen
function NewWindow(mypage,myname,w,h,scroll)
{
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',lef
t='+LeftPosition+',scrollbars='+scroll+',resizable
'
win = window.open(mypage,myname,settings)
}
Then by calling upon it from the html like so
href="mypage.htm" onclick="NewWindow(this.href, 'name' , '500' , '420', 'no'); return false"
But I cannot for the life of me fathom out how to do this from a menu_array.js file
My menu_array is working fine to a degree but all pages accessed via the menu all appear in the same window. I've hunted around and looked at other sites using a menu_array and noticed that they're the same. Maybe I'm not looking hard enough.
I could go back and use an html form but I think the javascript array looks much, much better,
I hope I've made myself clear. Thank you once again for reading. Any help would be much appreciated
From a Javascript Noob