I’ve been coming up with a JavaScript function called “centered” which is basically a new window function that will also open a new window in the centre of the screen.
I’ve got it working ok but I keep getting a JavaScript warning box saying “This object does not support this property…” yadda yadda…
Here’s the javascript code:
function centered(url,name,sizex,sizey) {
newwin = window.open(url,name,“width=”+sizex+",height="+sizey+",toolbar=no,location=no,directories=no,status=0,resizable=no,scrollbars=no,menubar=no");
centered.moveTo(((screen.width/2)-(sizex/2)),((screen.height/2)-(sizey/2)));
}
And the trigger for the function:
…href=“JavaScript:centered(‘http://www.kirupa.com’,‘Kirupa’,‘1000’,‘300’);”>open</a>
Where am I going wrong? Are there any more efficient scripts that can do a better job out there? Why is the sky blue? Did aliens really crash at Roswell? Who shot JFK?
Find out in the next exciting episode…!!
Thanks. ads.