Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mui
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mui
Commits
d24cd30f
Commit
d24cd30f
authored
Dec 27, 2014
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复offcanvas布局菜单页面在android 4.4.2版本下滑动触发不灵敏的问题
parent
20648ce7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
examples/hello-mui/examples/offcanvas-drag-left-plus-menu.html
...les/hello-mui/examples/offcanvas-drag-left-plus-menu.html
+4
-0
examples/hello-mui/examples/offcanvas-drag-right-plus-menu.html
...es/hello-mui/examples/offcanvas-drag-right-plus-menu.html
+4
-0
examples/hello-mui/index-mask.html
examples/hello-mui/index-mask.html
+4
-0
examples/hello-mui/index-menu.html
examples/hello-mui/index-menu.html
+5
-1
No files found.
examples/hello-mui/examples/offcanvas-drag-left-plus-menu.html
View file @
d24cd30f
...
@@ -64,6 +64,10 @@
...
@@ -64,6 +64,10 @@
mui
.
init
({
mui
.
init
({
swipeBack
:
false
swipeBack
:
false
});
});
//在android4.4.2中的swipe事件,需要preventDefault一下,否则触发不正常
window
.
addEventListener
(
'
dragright
'
,
function
(
e
)
{
e
.
detail
.
gesture
.
preventDefault
();
});
//左滑显示出来的菜单,只需监听右滑,然后将菜单关闭即可;在该菜单上左滑,不做任何操作;
//左滑显示出来的菜单,只需监听右滑,然后将菜单关闭即可;在该菜单上左滑,不做任何操作;
window
.
addEventListener
(
"
swiperight
"
,
function
()
{
window
.
addEventListener
(
"
swiperight
"
,
function
()
{
...
...
examples/hello-mui/examples/offcanvas-drag-right-plus-menu.html
View file @
d24cd30f
...
@@ -80,6 +80,10 @@
...
@@ -80,6 +80,10 @@
mui
.
init
({
mui
.
init
({
swipeBack
:
false
swipeBack
:
false
});
});
//在android4.4.2中的swipe事件,需要preventDefault一下,否则触发不正常
window
.
addEventListener
(
'
dragleft
'
,
function
(
e
)
{
e
.
detail
.
gesture
.
preventDefault
();
});
//优化显示出来的侧滑菜单,只需监听该菜单的左滑事件,然后将其关闭即可;在菜单上右滑,不做任何操作;
//优化显示出来的侧滑菜单,只需监听该菜单的左滑事件,然后将其关闭即可;在菜单上右滑,不做任何操作;
window
.
addEventListener
(
"
swipeleft
"
,
function
()
{
window
.
addEventListener
(
"
swipeleft
"
,
function
()
{
mui
.
fire
(
mui
.
currentWebview
.
opener
(),
"
menu:swipeleft
"
);
mui
.
fire
(
mui
.
currentWebview
.
opener
(),
"
menu:swipeleft
"
);
...
...
examples/hello-mui/index-mask.html
View file @
d24cd30f
...
@@ -20,6 +20,10 @@
...
@@ -20,6 +20,10 @@
mui
.
fire
(
index
,
"
menu:close
"
);
mui
.
fire
(
index
,
"
menu:close
"
);
}
}
window
.
addEventListener
(
'
tap
'
,
closeMenu
);
window
.
addEventListener
(
'
tap
'
,
closeMenu
);
//在android4.4.2中的swipe事件,需要preventDefault一下,否则触发不正常
window
.
addEventListener
(
'
dragleft
'
,
function
(
e
)
{
e
.
detail
.
gesture
.
preventDefault
();
});
window
.
addEventListener
(
'
swipeleft
'
,
closeMenu
);
window
.
addEventListener
(
'
swipeleft
'
,
closeMenu
);
</script>
</script>
</head>
</head>
...
...
examples/hello-mui/index-menu.html
View file @
d24cd30f
...
@@ -130,7 +130,11 @@
...
@@ -130,7 +130,11 @@
}
}
//点击“关闭侧滑菜单”按钮处理逻辑
//点击“关闭侧滑菜单”按钮处理逻辑
document
.
getElementById
(
"
close-btn
"
).
addEventListener
(
"
tap
"
,
close
)
document
.
getElementById
(
"
close-btn
"
).
addEventListener
(
"
tap
"
,
close
);
//在android4.4.2中的swipe事件,需要preventDefault一下,否则触发不正常
window
.
addEventListener
(
'
dragleft
'
,
function
(
e
)
{
e
.
detail
.
gesture
.
preventDefault
();
});
//监听左滑事件,若菜单已展开,左滑要关闭菜单;
//监听左滑事件,若菜单已展开,左滑要关闭菜单;
window
.
addEventListener
(
"
swipeleft
"
,
function
(
e
)
{
window
.
addEventListener
(
"
swipeleft
"
,
function
(
e
)
{
if
(
Math
.
abs
(
e
.
detail
.
angle
)
>
170
){
if
(
Math
.
abs
(
e
.
detail
.
angle
)
>
170
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment