注册 | 登陆
您的位置:阿里西西 > 前端技术 > HTML基础 > 详细内容

网页全屏显示代码

  稿源:互联网   2009-07-30 18:18:34   点击:   撤稿纠错
下面分享网页全屏显示代码,想做全屏显示效果的朋友可以参照下。

以下讨论的是和html相关的网页全屏显示代码 教程文章,内容是本站精心挑选整理的教程,希望对广大的网友给到帮助,下面是详细内容:

最常见的是使用window.open的方法,直接打开全屏网页:

<script>

script>

<center>
<form>
<input type="button" onClick="fullwin()" value="Open Full Screen Window">
form>
center> 

另外,如果想让已经打开的网页全屏,有以下两种方法:

1.使用ActiveX

<html>
<head>
<title>testtitle>
<script language="JavaScript">
function Fkey(){
     
var WsShell = new ActiveXObject('WScript.Shell')
     WsShell.SendKeys(
'{F11}');
}
script>
head>
<body>
<href="javascript:Fkey()">to fulla>
body>
html>

2.使用window.open模拟当前页:

<SCRIPT language="JavaScript">   
function   toFull(){   
  
if(window.name=="fullscreen")return;   
  
var a =window.open("","fullscreen","fullscreen=yes")   
  a.location 
= window.location.href   
  window.opener
=null   
  window.close()   
}   
SCRIPT>   
<html>   
<body>   
<input type=button value="full" onclick=toFull()>   
body>   
html>   


关于网页全屏显示代码的内容写到这里就结束啦,您可以收藏本页网址http://www.alixixi.com/web/ a/2009073057174.shtml方便下次再访问哦。