如何让a标签打开的页面为全屏?

如何让a标签打开的页面为全屏?

换了种思路,大致实现了想要的效果了

通过$.ajax加$(ele).html()实现,
只须让ele全屏即可
阅读 3.2k
1 个回答

直接打开就全屏是做不到的,现代浏览器是不会暴露这样的方法的,会引起极不舒适的用户体验。
一般来说必须得有用户操作才能做到全屏,如使用Element.requestFullscreen()方法,前提是在用户交互事件中使用这个方法。
而在ie7或更早版本中或许可以通过window.open(src, 'newWin', 'fullscreen="yes"')来全屏打开。
MDN 明确表明不行

How do I force a maximized window?
You cannot. All browser manufacturers try to make the opening of new secondary windows noticed by users and noticeable by users to avoid confusion, to avoid disorienting users.
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题