Hi ppl,
i have a prob here. i'm trying to do a webpage and putting it in a cd for viewers to view. so i found the script below to open a full screen windows. it work! but the prob is that it opens two pages. one normal window and a full screen window. any ways to code it in order to get just one full screen windows? thanks in advance :)


<SCRIPT LANGUAGE="JavaScript">
if (this.name!='fullscreen'){
window.open(location.href,'fullscreen','fullscreen,scrollbars')
}
</script>

<SCRIPT LANGUAGE="JavaScript">
if (this.name!='fullscreen'){
window.open(location.href,'fullscreen','fullscreen,scrollbars')
window.close(this)
}
</script>

The window close in the suggestion will require a confirm if the page was not opened by a script. An alternative is to obtain the screen size and to moveto and resize the window to be ful screen.

The window close in the suggestion will require a confirm if the page was not opened by a script. An alternative is to obtain the screen size and to moveto and resize the window to be ful screen.

That's in Internet Explorer; Firefox will refuse to close the window at all.
(And the "fullscreen" window Firefox generates will just be a normal size windows sans the top toolbars.)

Hi

I have the same problem, I want the page to be fullscreen when a user enters the page

window.onload = function () {
window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);
}

works in IE, Firefox, Safari.

Workaround(s) may be available for Opera and/or Chrome.

Thanks FXM, but this code doesnt seem to work. Can you please send me
the rest of it maybe, am not good with javascript

window.onload = function () {
window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);
}

works in IE, Firefox, Safari.

Workaround(s) may be available for Opera and/or Chrome.

Thanks FXM, but this code doesnt seem to work. Can you please send me
the rest of it maybe, am not good with javascript

Insert this

<script type="text/javascript">
    window.onload = function () {
        window.moveTo(0, 0);
        window.resizeTo(screen.availWidth, screen.availHeight);
    }
</script>

before the </head> tag.

Either ship the CD with one of the browsers in which it works or wait for a cross-browser version.

Note: this code assumes that there are no existing onload= functions in the page(s) to be displayed. If there are, it gets a bit more complicated.

Thanks I tyed the code and it doesnot work

Don't tye - or type - use copy-and-paste.

Which browser are you using? Have you made sure that javascript is enabled?

Note: some browsers can be configured to disable resizing. Opera purports to support both moveTo() and resizeTo() but I couldn't get them to work here. Chrome doesn't work here either, but I haven't found any claim of support.

Edited 6 Years Ago by fxm: n/a

I am using firefox 3.5.9 and javascript is enabled an all. I got this code from
the internet and it works:

<script language="JavaScript">
function fullscreen() {
Width=screen.availWidth;
Height=screen.availHeight;
window.open('fullscreen.html', '',
'toolbar=no,location=no,directories=no,status=no,menubar=no,'+
'scrollbars=1,resizable=no,copyhistory=1,width='+Width+','+
'height='+Height+',top=0,left=0','replace');
}
</script>

But the problem with this code is that it opens another window and make it full screen. What I want is for the current screen to be Full screen on load.

Thanks

This article has been dead for over six months. Start a new discussion instead.