【发布时间】:2015-05-04 15:38:35
【问题描述】:
我有一个奇怪的问题。我有一台 LG g700 平板电脑,我想将方向设置为锁定。但是当我在我的 nexus 5 上测试它时,它适用于以下代码:
window.screen.orientation.lock("landscape")
但是当我在平板电脑上执行相同的代码时,它不起作用,并且会出现如下错误:
Uncaught (in promise) DOMException: The page needs to be fullscreen in order to call lockOrientation(). {message: "The page needs to be fullscreen in order to call lockOrientation().", name: "SecurityError", code: 18, INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2…}code: 18message: "The page needs to be fullscreen in order to call lockOrientation()."name: "SecurityError"__proto__: DOMException
有解决办法吗?
【问题讨论】:
标签: javascript jquery html orientation