工作我試圖當設備的屏幕的尺寸調整爲重新安排的佈局,所以我這樣做:聚合物/深/選擇未在移動設備
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)
任何想法? 謝謝!
謝謝,現在我明白了。但有辦法在不支持的瀏覽器中深入查詢? (感謝這項工作!我在IO14上觀看了你的演示文稿,這一切都很棒:)) – Apoth