<script type="text/javascript"> //IE var shell = new ActiveXObject("WScript.Shell"); shell.SendKeys("{F11}"); </script>
javascript 里 document.onkeydown = hotkeyonkeydown;hotkeyonkeydown函数写入 if (event.keyCode==122){funButtonClick('ButtonClickF11');/*event.keyCode=0;event.returnValue=false;*/} //屏蔽F11另写 function funButtonClick(buttonID) { //按ButtonID为名字查找button,找到后启动click事件 var srry; var sre; var bre; bre=1; var sTmp; var sTmp1; var lPos;
http://news.qq.com/a/20130925/008856.htm#p=1
幻灯播放边上有个全屏播放,用flash做的。看看源码。
好的!谢谢哦!
所以 对于IE 你懂的
<script type="text/javascript">
//IE
var shell = new ActiveXObject("WScript.Shell");
shell.SendKeys("{F11}");
</script>
document.onkeydown = hotkeyonkeydown;hotkeyonkeydown函数写入
if (event.keyCode==122){funButtonClick('ButtonClickF11');/*event.keyCode=0;event.returnValue=false;*/} //屏蔽F11另写
function funButtonClick(buttonID)
{
//按ButtonID为名字查找button,找到后启动click事件
var srry;
var sre;
var bre;
bre=1;
var sTmp;
var sTmp1;
var lPos;
for(i=0;i<document.all.length;i++)
{
sTmp=document.all(i).name;
if(sTmp!=null)
{
sTmp=sTmp.toUpperCase();
lPos=sTmp.indexOf(buttonID.toUpperCase());
if(lPos!=-1)
{
document.all(i).click();
return true;
}
}
}
return false;
}最后,页面上,放一个后台按钮,取名"ButtonClickF11".
就可以了
按钮要隐藏的话,请用前台方法才可以。
<html>
<head>
<title>test</title>
<script language="JavaScript">
function Fkey(){
var WsShell = new ActiveXObject('WScript.Shell')
WsShell.SendKeys('{F11}');
}
</script>
</head>
<body>
<a href="javascript:Fkey()">屏幕切换</a>
</body>
</html>