Forum Moderators: phranque

Message Too Old, No Replies

Why doesn't my var name.focus comand work!?

How do i open a new window onLoad and put it on top?

         

Baxter30

1:42 am on Nov 26, 2008 (gmt 0)

10+ Year Member


I am designing a simple program for my neice and nephew and would like to be able to open a window from the desk top into a fullscreen window. I have explored a number of ways to do this and none seem to work quite as effectively as I had hoped.

Attempt number one was useing a javascript statement to resize the window to fullscreen(true fullscreen without access to the address bar or any means of escape). It seems this command does not exist.

Attempt number two was to use an
onLoad="window.open('win.html','name','fullscreen')"
comand in conjunction with a self.close() command to open the new window and close the current. This proved slightly annoying because the window will prompt you because the it is trying to close itself.

Attempt number three and focus of my post is to use a js function to open the new window and focus and it instead of the current. It looks like this:

<html>
<head>
</head>

<script type="text/javascript" language="JavaScript">
<!--
function home() {
var index = window.open('indexh.html', 'index', 'fullscreen')
index.focus()
}
-->
</script>

<body bgcolor=black onLoad="home()">
</body>
</html>

Im new to webdesign and im sure there is some simple answer stareing me in the face.

Baxter

kaled

2:47 am on Nov 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm half asleep right now, but I think this would typically fail due to popup blockers - but depending on what browser you are using, you may be able to permit a popup in this instance. I think you also need to use "fullscreen=yes"

You may do better in the javascript forum.

[webmasterworld.com...]

Kaled.

Baxter30

3:54 am on Nov 26, 2008 (gmt 0)

10+ Year Member



I had no idea there was a javascript forum. Thanks for the heads up. And its not as much the window opening im having trouble with as putting the opened window on top.