javascript - 在 IE 10 中请求全屏
问题描述
我尝试使用下面的功能
function goFullscreen(id) {
var element = document.getElementById(id);
if (element.msRequestFullScreen) {
element.msRequestFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
我希望在 IE 10 中支持 Javascript,因为浏览器在 IE 10 中运行,但请求全屏仅支持 IE 11。有什么方法可以在 IE 10 中支持?
解决方案
对您有用的方法之一是使用:
var myWindow = window.open("", "_self");
myWindow.document.write("<p>I´m ready</p>");
您只需传递带有 html 和必要功能的对象。我希望它对你有用
在我的代码中,我直接打开特定窗口并为我需要的功能做好准备
function openFullWindow(CTri) {
if (window.name != 'salidas') {
url_src = "test.asp?Indice=<%=indice%>&Numero=<%=numero%>&IdUser=<%=iduser%>&CodTribunal="+CTri;
w=800;
h=600;
if (window.screen) {
w = window.screen.availWidth;
h = window.screen.availHeight;
}
manejadorVentana = window.open(url_src, "salidas", "toolbar=no,location=no,directories=no,scrollbars=yes,menubar=no,width="+w+",height="+h+",top=0,left=0");
}
}
从大窗口启动到小窗口的事件是window.opener
推荐阅读
- android - MutableLiveData 可以有一个子类作为它的类型吗?
- mysql - 需要从项目表中获取所有项目,包括所有提供的标签 ID WITH SEQUELIZE
- python - 循环在装饰器中如何工作(记忆)
- c++ - 在访问 struct 的不同属性的 C++ 函数中重用代码
- cucumber - 在 HTML 编辑器中插入文本
- python - 如何使用 selenium 抓取 Whatsapp 网页的元素
- reactjs - 带有双破折号的 CSS 选择器
- wpf - 如何提供静态资源作为类的值
? - c++ - 无法更新类内字段的值
- laravel - Laravel:集合中的 OrderBy 嵌套对象