fullscreen through javascript

烂漫一生 提交于 2019-12-02 03:53:30

问题


well making a page fullscreen is one of my favorite topics but whenever I have thought of doing it, I have always received one answer and that is, it is only done with flash. For the first time today I saw one that is not done with flash, can someone tell me how exactly it is done, so I could atlast full my dream of using it ^^ here is the image http://content.screencast.com/users/cryoffalcon/folders/Jing/media/5ac91f6f-ed2f-4312-b8e3-3ac9771f5497/2012-04-13_0001.png

and here is the link to the page where this fullscreen button exists. http://tutorialzine.com/2010/09/html5-canvas-slideshow-jquery/


回答1:


Some browser support this through html5.

Try

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


来源:https://stackoverflow.com/questions/10131888/fullscreen-through-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!