Commit 48c06526 authored by 崔红保's avatar 崔红保

解决右滑菜单在androd 4.4.2版本上触发不灵敏的问题

parent 75cce942
...@@ -224,6 +224,13 @@ ...@@ -224,6 +224,13 @@
//点击左上角图标,打开侧滑菜单; //点击左上角图标,打开侧滑菜单;
document.querySelector('.mui-icon-bars').addEventListener('tap', openMenu); document.querySelector('.mui-icon-bars').addEventListener('tap', openMenu);
//在android4.4.2中的swipe事件,需要preventDefault一下,否则触发不正常
window.addEventListener('dragright', function(e) {
e.detail.gesture.preventDefault();
});
window.addEventListener('dragleft', function(e) {
e.detail.gesture.preventDefault();
});
//主界面向右滑动,若菜单未显示,则显示菜单;否则不做任何操作; //主界面向右滑动,若菜单未显示,则显示菜单;否则不做任何操作;
window.addEventListener("swiperight",openMenu); window.addEventListener("swiperight",openMenu);
//主界面向左滑动,若菜单已显示,则关闭菜单;否则,不做任何操作; //主界面向左滑动,若菜单已显示,则关闭菜单;否则,不做任何操作;
...@@ -242,4 +249,4 @@ ...@@ -242,4 +249,4 @@
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment