全屏页面加载 [英] Full Screen on Page Load

查看:89
本文介绍了全屏页面加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以全屏模式打开页面.我单击任何按钮都可以完成此操作,有人可以告诉我页面加载是否可能?

如果有人有任何解决方案,请帮助我.

以下代码适用于javascript中的click事件

I want to open page in full screen mode. i have done it on the click of any button can anyone tell me that is it possible on page load?

If anyone has any solution please help me.

the following code works on click event in javascript

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



谁能告诉我如何在页面加载时实现它?



can any one tell me how can i achieve it on page load?

推荐答案

尝试这些代码

Try these codes

<script language="jscript" type="text/jscript" >


(document).ready(function(){ //发布您的代码 }); < /script >
(document).ready(function () { //Post your code }); </script>







or

<script language="javascript" type="text/javascript">
window.onload = function () {
//Post your code
}
</script></script>


这篇关于全屏页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆