# Force a window to open full-screen from an <a href...> tag



## andynic

Hi,

Given the following construct:

Monreale


Is there a syntax that would force the browser to resize the page to full-screen?

Thanks,
Andy


----------



## ehymel

The following code is modified very slightly from this page, found via google:



Code:


<script language="JavaScript">

function maxWindow()
{
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;
  }
}
}
</script>

You can call it with this:



Code:


<a style="font-family: Arial; font-style:Normal; font-size:10pt; color:black; text-decoration:none" href="MonrealeSlides.html" onclick="javascript:maxWindow()">


----------



## andynic

Hi ehymel,
Thanks for the reply to my post.
I put the code in my html file, and it does transfer control to the new link, but it does not resize the window. It behaves the same way as the orginial code that I posted.
I copied the function into the section of the script and replaced the <a> tag with the code you suggest.
Any idea what I might be doing wrong?
Andynic


----------



## ehymel

Can you post the URL of the page you are working on? Perhaps something else on the page is affecting this.


----------



## omuyelijah

Hi Andynic,

Have this for HTML ...:
 Monreale 

... and the function maxwindow:

function maxwindow(obj, sv)
{
window.open(this.href+sv, 'win_name','channelmode=1,scrollbars=1');
}


----------



## omuyelijah

Hi Andynic,

Have this for HTML ...:
 Monreale 

... and the function maxwindow:

function maxwindow(obj, sv)
{
window.open(this.href+sv, 'win_name','channelmode=1,scrollbars=1');
}


----------



## andynic

Hi omuyelijah,

I've tried what both you and ehymel have suggested and both keep the window the same size as it originally was. That is the proposed solutions do not force the window to resize to full screen. Any other ideas?

Thanks for your interest.
Andynic


----------



## h00dstoker

Nice good,
this will help me a lot


----------



## Elvandil

Most people do this with javascript, but only if certain scripts haven't been blocked in browser settings.


----------



## ehymel

hmmm, the code I posted works for me in both Firefox 3 and IE8. What are you using?

According to this page, channelmode only applies to IE, though you can modify it for other browsers. Sounds like javascript will offer more compatibility though.


----------



## ehymel

One important note: the method I posted (haven't tried the other) only works if the page you are working in is the only tab. If you have multiple tabs open, then the window does not get resized, you just get another tab.

Looking into my original reference, that page was for older versions of IE, pre-dating tabs. Time to keep looking!


----------



## ehymel

ok, putting together some info from several different pages on the window.open method in javascript, this seems to be working for me, even from within tabbed pages:



Code:


function fullScreen(theURL) {
params  = 'width='+screen.width;
params += ', height='+screen.width;
params += ', location=1,status=1,scrollbars=1,menubar=1';
testwindow= window.open (theURL, '', params);
testwindow.moveTo(0,0);
}

This is called from something like:


Code:


<a style="font-family: Arial; font-style:Normal; font-size:10pt; color:black; text-decoration:none"
href="javascript:void(0);" onclick="fullScreen('test.php')">
Monreale
</a>

Try googling window.open method. There are several options that let you choose whether the new window has scrollbars, menus, etc. There is also a true full-screen mode (perhaps what you were really wanting??).


----------



## omuyelijah

Hi,

Got to check a javascript reference documentation and some weblications I wrote. The reference says to get fullscreen mode, theatre mode must be on [i.e. talking about the windows specifications in the window.open(...) method]. However, goggling the window.open(..) method reveals some online specification stating that fullscreen mode is not supported by some browsers.


----------



## omuyelijah

Hi,

Got to check a javascript reference documentation and some weblications I wrote. The reference says to get fullscreen mode, theatre mode must be on [i.e. talking about the windows specifications in the window.open(...) method]. However, goggling the window.open(..) method reveals some online specification stating that fullscreen mode is not supported by some browsers.


----------

