最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - How can Google Docs go fullscreen in JavaScript - Stack Overflow

programmeradmin2浏览0评论

How can Google Docs go fullscreen in JavaScript?
In a Google Docs Presentation, when you press the fullscreen button at the lower left corner of the window, the window goes fullscreen.
It is not Flash so I am curious that how can Google do that?

Added

Note that it is not creating a big window that fits the screen (that's fake fullscreen). It is actually in fullscreen mode, and Google Chrome asked for my permission.

How can Google Docs go fullscreen in JavaScript?
In a Google Docs Presentation, when you press the fullscreen button at the lower left corner of the window, the window goes fullscreen.
It is not Flash so I am curious that how can Google do that?

Added

Note that it is not creating a big window that fits the screen (that's fake fullscreen). It is actually in fullscreen mode, and Google Chrome asked for my permission.

Share Improve this question edited Oct 21, 2011 at 0:05 Derek 朕會功夫 asked Oct 20, 2011 at 23:51 Derek 朕會功夫Derek 朕會功夫 94.5k45 gold badges198 silver badges253 bronze badges 3
  • where is the fullscreen button? I can't seem to find it. – tr4656 Commented Oct 21, 2011 at 0:19
  • @tr4656, In a Webkit browser, open a Google Docs Presentation (new), and the button is at the lower left corner of the window. – Derek 朕會功夫 Commented Oct 21, 2011 at 0:47
  • OK, I myself did a little research on it and found out that a little trick would do it: <button onclick="document.body.webkitRequestFullScreen()">Fullscreen</button> – Derek 朕會功夫 Commented Oct 21, 2011 at 2:41
Add a ment  | 

2 Answers 2

Reset to default 7

It seems they are using the technique described in this article: http://www.thecssninja./javascript/fullscreen

// Mozilla
element.mozRequestFullScreen();

// Webkit
element.webkitRequestFullscreen();

Edit: That article forgets to mention that if you want the whole page fullsreen you can do document.body.webkitRequestFullscreen();.

I've tested the code given in this question on Internet Explorer 9:

How to make browser full screen using F11 key event through JavaScript

At least for Internet Explorer 9, though, the permission dialog might be misleading.

发布评论

评论列表(0)

  1. 暂无评论