Polymer TogglePanel在iphone上闪烁

时间:2014-11-15 07:15:52

标签: android ios iphone polymer

我正在尝试使用聚合物制作单页。 这些代码在Android移动网络和桌面上运行良好,但在iphone(chrome& safari)上,每当我尝试切换菜单栏面板时,屏幕都会闪烁

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Polymer Single App</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script src="../bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="../bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="../bower_components/core-menu/core-menu.html">
<link rel="import" href="../bower_components/core-item/core-item.html">
<link rel="import" href="../bower_components/core-icons/core-icons.html">
<link rel="import" href="../bower_components/core-scaffold/core-scaffold.html">
<link rel="import" href="../bower_components/core-header-panel/core-header-panel.html">
<link rel="import" href="../bower_components/core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../bower_components/paper-item/paper-item.html">

<body unresolved fullbleed>
<core-drawer-panel id="drawerPanel" rightDrawer forceNarrow>
  <core-header-panel main>
    <core-toolbar id="mainheader">
      <div flex>
        <img src="../images/logo.png" width="152" height="32">
      </div>
      <paper-icon-button id="navicon" icon="menu"></paper-icon-button>
    </core-toolbar>
    <div class="content">
      If drawer is hidden, press button to display drawer.
    </div>
  </core-header-panel>
  <core-header-panel drawer>
    <core-toolbar id="navheader">
      <span>Menu</span>
    </core-toolbar>
    <core-menu>
      <core-item label="One"></core-item>
      <core-item label="Two"></core-item>
    </core-menu>
  </core-header-panel>
</core-drawer-panel>
</body>

<script>
document.addEventListener('polymer-ready', function() {
  var navicon = document.getElementById('navicon');
  var drawerPanel = document.getElementById('drawerPanel');
  navicon.addEventListener('click', function() {
    drawerPanel.togglePanel();
  });
});
</script>
</html> 

谢谢!

1 个答案:

答案 0 :(得分:1)

尝试使用以下CSS:

* {
-webkit-tap-highlight-color: transparent;
}