Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

检测浏览器是否支持横屏的方法是否应该完善一下? #91

Closed
sjxg opened this issue Jul 17, 2017 · 1 comment
Closed

Comments

@sjxg
Copy link

sjxg commented Jul 17, 2017

检测浏览器是否支持横屏,window.orientation 已经不建议使用。并且在现代浏览器中,即使 'orientation' in window 返回false,window 实际上也可以绑定 orientationchange 事件。有一个实验性的特性,但是并没有被 Safari 支持。另外,参照这里'ondevicemotion' in window 在 Chrome/FF 下是可以正确检测的。
希望检测的方法能完善一下。

@06wj
Copy link
Member

06wj commented Jul 17, 2017

'orientation' in window || 'orientation' in window.screen 这样就可以了吧

ondevicemotion是检测手机方向的 和这个不一样

@06wj 06wj closed this as completed in 93537c7 Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants