Page 1 of 1

Full screen

Posted: Fri Jul 31, 2009 6:18 am
by quioske
Hi all,

I am on to the maintenance of PHP web based application.

the application is currently opening in browser with all sort of tool bar and address bar.

i want to make the application to open in full screen with only close button at the top-right corner.

how can i do this

thanks in advance

Re: Full screen

Posted: Fri Jul 31, 2009 6:28 am
by jackpf
You'll want to look into javascript's window.open() method.

Re: Full screen

Posted: Fri Jul 31, 2009 6:34 am
by quioske
In the application, they are not using window.open() .

is there any other way through which i can do this , like CSS.

i cannot change the code.

thanks for the reply

Re: Full screen

Posted: Fri Jul 31, 2009 6:43 am
by jackpf
I don't think you can do this without opening a new window.

You certainly can't do it with CSS...as this would be very intrusive, and I doubt any browser would let you.

I'm under the impression that the only way is with javascript, using window.open(). I've done a bit of googling and haven't found anything different.

Why can you not edit the code, may I ask?

Re: Full screen

Posted: Fri Jul 31, 2009 6:51 am
by quioske
jackpf,thanks for the reply

i have to go through the updation of code on each n every page.

That is the reason , i am looking for some external coding to open the application in full screen

i have seen it is using include_once() to open the file.

Re: Full screen

Posted: Fri Jul 31, 2009 7:28 am
by jackpf
I think you misunderstand - this is javascript, not php.

All you need to do is open the application using window.open(). So all you should need to change is the index page.

Re: Full screen

Posted: Fri Jul 31, 2009 7:32 am
by quioske
can u pls tell me how to do this with window.open()

i need only close button there

thanks for the reply jackpf

you have helped me a lot

Re: Full screen

Posted: Fri Jul 31, 2009 7:34 am
by jackpf
Well, on the index page, you could put something like this:

echo '<a href="#" onclick="window.open(\''.$_SERVER['PHP_SELF'].'\', \'full_screen\', \'toolbars=no, width=1000, height=750\');">Click here to open application in full screen</a>';

(I didn't include it in

Code: Select all

tags since it strips out escaped quote...cause it's stupid.)

Re: Full screen

Posted: Mon Aug 03, 2009 6:54 am
by quioske
thanks for the reply,

But what i need is a PHP code to open the page in full screen automatically.

thanks

Re: Full screen

Posted: Mon Aug 03, 2009 7:43 am
by jackpf
You can't do that with PHP. That's why I'm showing you how to do it in javascript.

If you want it to open automatically, you can use:

Code: Select all

window.onload = function()
{
window.open(.......open the window...
}

Re: Full screen

Posted: Wed Aug 05, 2009 8:18 am
by quioske
Hi,

I am using this script to resize the window.

it is working fine in IE and mozilla, but not working in chrome and safari.

i need cross browser compatibility for all browser

moreover this code is not hiding the menu bar , addressbar .

(this script is taken from microsoft website(http://support.microsoft.com/kb/287171)
any one has idea,how can i do this ?

Code: Select all

<script language="JavaScript">
window.onload = maxWindow;
 
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>
 

Re: Full screen

Posted: Thu Aug 06, 2009 8:05 am
by jackpf
My god, never use anything off the Microsoft website.

This is how I'd do it:

Code: Select all

window.resizeTo(window.innerWidth, window.innerHeight);
And when using window.open(), you need to specify 'toolbar=false' as the third argument.

Re: Full screen

Posted: Thu Aug 06, 2009 10:34 pm
by quioske
With window.resize,Can I specify that menubar and toolbar should be off?

Re: Full screen

Posted: Fri Aug 07, 2009 8:10 am
by jackpf
No, like I said, you have to do that with window.open.