Adil
Adil

Reputation: 4623

fullscreen on click - Ext JS

How can I make my browser switch to fullscreen mode by clicking on a button, I'm looking for any type of solution, I mean based on Ext JS, Javascript, HTML5 or other tricks if you have one

Upvotes: 4

Views: 1691

Answers (2)

Adil
Adil

Reputation: 4623

I have found this solution

var docElm = document.documentElement;
if (docElm.requestFullscreen) {
   docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
   docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
   docElm.webkitRequestFullScreen();
}

and for cancelling fullscreen :

if (document.exitFullscreen) {
   document.exitFullscreen();
}
else if (document.mozCancelFullScreen) {
   document.mozCancelFullScreen();
}
else if (document.webkitCancelFullScreen) {
    document.webkitCancelFullScreen();
}

this work for me using ExtJS 4.0.7 with chrome

full explanation here.

Upvotes: 2

tonio
tonio

Reputation: 2376

Not widely supported but there’s https://developer.mozilla.org/en/DOM/Using_full-screen_mode

Upvotes: 2

Related Questions