469,288 Members | 2,353 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,288 developers. It's quick & easy.

JS to switch to full page view (F11 key)

SPG
Hi,

We have a web app that is IE dependant.

We now have a requirement to have a button on one of our menus to force the
page into full screen view as if the client pressed F11. (It'll do other
things like hide some of our frames and other screen data too, but that is
the easy part.)

We cannot re-load the screen using window.open(blah), it has to be done as
if they pressed F11.

I have googled this a bit and have only found psuedo solutions (Like just
resizing the screen to fit the resolutions etc).

Was wondering if anyone out there has managed to do this at all?

Steve
Jul 23 '05 #1
5 19744
On Tue, 16 Nov 2004 13:27:29 GMT, "SPG"
<st*******************@nopoo.blueyonder.co.uk> wrote:
We now have a requirement to have a button on one of our menus to force the
page into full screen view as if the client pressed F11. (It'll do other
things like hide some of our frames and other screen data too, but that is
the easy part.)

Was wondering if anyone out there has managed to do this at all?


Only by using Zeepe

http://www.meadroid.com/zeepe/

Jim.
Jul 23 '05 #2
SPG
Hmm..

Didn't want to use a 3rd party kit.. Banks don't like them!

Sort of did it in a demo by doing this:

<html>
<head>
<SCRIPT LANGUAGE=VBScript>
<!-- //
Dim bState

Function SwitchView()
bState = not bState
Set objInetExp = CreateObject("InternetExplorer.application")
objInetExp.TheaterMode=bState
End Function
// -->
</SCRIPT>

</head>
<body>
<input type="button" value="Switch" onclick="SwitchView()">
</body>

But it still seems to open a new blank page instead of effecting the
existing one. I think I will have a play with this obekct and see if I can
specify the window to effect.

Steve
"Jim Ley" <ji*@jibbering.com> wrote in message
news:41***************@news.individual.net...
On Tue, 16 Nov 2004 13:27:29 GMT, "SPG"
<st*******************@nopoo.blueyonder.co.uk> wrote:
We now have a requirement to have a button on one of our menus to force
the
page into full screen view as if the client pressed F11. (It'll do other
things like hide some of our frames and other screen data too, but that is
the easy part.)

Was wondering if anyone out there has managed to do this at all?


Only by using Zeepe

http://www.meadroid.com/zeepe/

Jim.

Jul 23 '05 #3
On Tue, 16 Nov 2004 14:47:38 GMT, "SPG"
<st*******************@nopoo.blueyonder.co.uk> wrote:
But it still seems to open a new blank page instead of effecting the
existing one. I think I will have a play with this obekct and see if I can
specify the window to effect.


The amount of script to do it to the existing window would be very
significant, you can't create a new object, you'll need to get a
reference to the existing one.

I've also never seen a bank which allows full unreserved script
priviliges to an intranet app, but don't accept the 3rd party app, in
fact there's a good chance they're using meadco stuff anyway, it being
used in print workflows the world over.

Jim.
Jul 23 '05 #4
SPG wrote:
Hmm..

Didn't want to use a 3rd party kit.. Banks don't like them!

Sort of did it in a demo by doing this:

<html>
<head>
<SCRIPT LANGUAGE=VBScript>
<!-- //
Dim bState

Function SwitchView()
bState = not bState
Set objInetExp = CreateObject("InternetExplorer.application")
objInetExp.TheaterMode=bState
End Function
// -->
Why are you using JavaScript comments in a VBScript?
</SCRIPT>

</head>
<body>
<input type="button" value="Switch" onclick="SwitchView()">
</body>

But it still seems to open a new blank page instead of effecting the
existing one. I think I will have a play with this obekct and see if I can
specify the window to effect.


There is already a key that does what you want (F11). Why not educate users to
use that already provided functionality, then trap when they do it:

<div style="position:absolute;width:100%;text-align:right;top:0px;">Hit F11 to
maximize</div>
<script type="text/javascript">
window.onresize = function() {
if (window.screenLeft < 0) {
alert('fullscreened');
} else {
alert('windowed');
}
}
</script>

Note when the window is fullscreened, you get two alert()s and when the window
is windowed, you get three. So you'll need to set a flag to only handle the
event (and remove menus or whatever else you want to do) once.

Alternatively (and probably better):

<div style="position:absolute;width:100%;text-align:right;top:0px;">Hit F11 to
maximize</div>
<script type="text/javascript">
document.onkeyup = function() {
if (event.keyCode == 122) {
if (window.screenLeft < 0) {
alert('fullscreened');
} else {
alert('windowed');
}
}
}
</script>

Also note the assumption that window.screenLeft is negative when the window is
fullscreened. This assumption needs to be tested. There may be a better way to
determine what state the window is in.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #5
In article <5f******************@text.news.blueyonder.co.uk >,
st*******************@nopoo.blueyonder.co.uk enlightened us with...
Hi,

We have a web app that is IE dependant.

We now have a requirement to have a button on one of our menus to force the
page into full screen view as if the client pressed F11.


IE removed that functionality due to abuse.
Here are a few solutions to kiosk mode provided by MS.
<URL: http://support.microsoft.com/kb/q166367/>

--
--
~kaeli~
In democracy your vote counts. In feudalism your count votes.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Prakash Wadhwani | last post: by
9 posts views Thread by Jensen bredal | last post: by
11 posts views Thread by Richard | last post: by
1 post views Thread by Y. Sommer | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.