Calling Browser Function for Fullscreen window using Java Script on IE

Hi All,

In this article I will show how to call browser function to full screen the window using Java Script+ActiveX. This example is based on IE. although it is very easy to use Window.open method in Java script to achieve the same but sometime we might face the need to use the same behavior which IE browser F11 gives.

function fullScreenWindow()
{
try{
// Get the ActiveX object from the Window
var acvxObj= new ActiveXObject("Wscript.shell");
// Now sends a key to fullscreen
acvxObj.SendKeys("{F11}");
}catch(e){

}
}

You can use the same function for any toggling full screen effect.

[NOTE] Whenever you call this method you will get a confirmation from IE Browser for ActiveX use.

Hope this helps.


Thanks
R Vashi.

Advertisements

One thought on “Calling Browser Function for Fullscreen window using Java Script on IE

  1. A.Ramesh

    good day vashi,

    I tried this script, it is working fine in only IE8 & IE6 browsers.
    Is there any script for google chrome and mozilla.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s