PDA

View Full Version : Full Screen on page open


donbmjr
03-28-2003, 03:03 AM
I have many large graphs to display on our site. For best effect
I want the page when opened to go to full screen.
I want to open these pages using a standard menu, in this case menu machine. All I am able to find so far is a java script On Click to open the page which I do not want to use.

Thanks

Don Miller

glenngv
03-28-2003, 03:45 AM
put this inside the head tag:


<script language="javascript">
function autoMax(){
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if

(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}

autoMax();
</script>

donbmjr
03-28-2003, 04:12 AM
Hi Glenn
I could not get it to work on a test page, below is how it is pasted

Don Miller



<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>Test Page</title>
<link href="../css/awc.css" rel="stylesheet" media="screen">

<script language="javascript">
function autoMax(){
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if

(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}

autoMax();
</script>


</head>

<body background="../images/backgrounds/bggraylite2.gif" bgcolor="#ffffff" leftmargin="30" marginheight="30" marginwidth="30" topmargin="37">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

glenngv
03-28-2003, 07:14 AM
it works for me in IE5.5, NS4.7 and NS6

Quiet Storm
03-28-2003, 03:10 PM
Doesn't work...

Code resizes window to full width, not fullscreen.

Opening a window fullscreen from the start can't be done. You can, however, open a fullscreen window and close the original using JS. Definately NOT suggested, but possible - you'll upset a lot of your visitors if you close the existing window.

:eek:

glenngv
03-30-2003, 06:16 AM
what I meant with "fullscreen" was "maximize" the window since you cannot make a window not opened as window.open as fullscreen.

patrick
03-31-2003, 11:41 AM
hi glenn,

I don't exactly understand what you mean, but maybe these scripts will help you. I used them on a digital photoalbum.

On one page i placed this in the head tag. It opens the document in a new fullscreen window without any bars around it.

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

I used this function to open another document in a similar window when clicking a link.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function fotogroot() {
window.open(href='fotogroot.html','fotogroot','fullscreen',scrollbars=00)
}
// End -->
</script>

I used this to close the window in a frame.
<A HREF="#close" OnClick=parent.close()>Sluiten</A>
And this for a normal window.
<a href="jan" onClick = 'self.close()'> Terug </a>



<A HREF="#close" OnClick=parent.close()>Sluiten</A>


I have little or no knowlage of javascript, but i got these scripts from another scriptsite, and it worked for me. Good luck.

patrick