【发布时间】:2014-09-11 14:03:36
【问题描述】:
我试图在调整设备屏幕大小时重新排列布局,所以我这样做:
if(screenOrientation == SCREEN_ORIENTATION_LANDSCAPE) {
document.querySelector("html /deep/ [landscape-horizontal]").removeAttribute('vertical');
document.querySelector("html /deep/ [landscape-horizontal]").setAttribute('horizontal', '');
}
这在台式机上正常工作,但在移动设备(Android 手机、平板电脑和 iOS 模拟器)中出现此错误:
"Uncaught SyntaxError: Failed to execute 'webkitMatchesSelector' on 'Element': 'html /deep/ [landscape-horizontal]' is not a valid selector.", source: bower_components/platform/platform.js (0)
有什么想法吗? 谢谢!
【问题讨论】:
标签: javascript html css-selectors polymer shadow-dom