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
9316e55c
Commit
9316e55c
authored
Feb 13, 2015
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
“敲击顶部、回到顶部”功能改为双击操作
parent
8d62aecb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
45 deletions
+54
-45
examples/hello-mui/examples/template.html
examples/hello-mui/examples/template.html
+8
-2
examples/hello-mui/examples/template_pullrefresh.html
examples/hello-mui/examples/template_pullrefresh.html
+7
-1
examples/hello-mui/index.html
examples/hello-mui/index.html
+39
-42
No files found.
examples/hello-mui/examples/template.html
View file @
9316e55c
...
...
@@ -75,6 +75,12 @@
<script
src=
"../js/mui.min.js"
></script>
<script
src=
"../js/app.js"
></script>
<script
type=
"text/javascript"
>
//启用双击监听
mui
.
init
({
gestureConfig
:{
doubletap
:
true
}
});
var
titleElem
=
document
.
getElementById
(
"
title
"
)
var
menu
=
document
.
getElementById
(
"
menu
"
)
...
...
@@ -99,11 +105,11 @@
}
contentWebview
.
evalJS
(
'
mui("#topPopover").popover("toggle")
'
);
});
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
tap
'
,
function
()
{
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
double
tap
'
,
function
()
{
if
(
contentWebview
==
null
){
contentWebview
=
plus
.
webview
.
currentWebview
().
children
()[
0
];
}
contentWebview
.
evalJS
(
'
window.scroll(0,
0)
'
);
contentWebview
.
evalJS
(
'
mui.scrollTo(0, 10
0)
'
);
});
</script>
...
...
examples/hello-mui/examples/template_pullrefresh.html
View file @
9316e55c
...
...
@@ -68,6 +68,12 @@
<script
src=
"../js/mui.min.js"
></script>
<script
src=
"../js/app.js"
></script>
<script
type=
"text/javascript"
>
//启用双击监听
mui
.
init
({
gestureConfig
:{
doubletap
:
true
}
});
var
titleElem
=
document
.
getElementById
(
"
title
"
);
window
.
addEventListener
(
"
updateHeader
"
,
function
(
e
)
{
var
title
=
'
下拉刷新和上拉加载更多
'
;
...
...
@@ -79,7 +85,7 @@
if
(
contentWebview
==
null
){
contentWebview
=
plus
.
webview
.
currentWebview
().
children
()[
0
];
}
contentWebview
.
evalJS
(
'
window.scroll(0,
0)
'
);
contentWebview
.
evalJS
(
'
mui.scrollTo(0, 10
0)
'
);
});
</script>
...
...
examples/hello-mui/index.html
View file @
9316e55c
...
...
@@ -9,8 +9,6 @@
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"css/mui.min.css"
>
<script
src=
"js/mui.min.js"
></script>
<script
src=
"js/update.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
</head>
<body>
...
...
@@ -19,6 +17,8 @@
<a
id=
"info"
class=
"mui-icon mui-icon-info-filled mui-pull-right"
style=
"color: #999;"
></a>
<h1
class=
"mui-title"
>
Hello mui
</h1>
</header>
<script
src=
"js/mui.min.js"
></script>
<script
src=
"js/update.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script>
var
menu
=
null
,
main
=
null
;
...
...
@@ -26,6 +26,9 @@
mui
.
init
({
swipeBack
:
false
,
statusBarBackground
:
'
#f7f7f7
'
,
gestureConfig
:{
doubletap
:
true
},
subpages
:
[{
id
:
'
list
'
,
url
:
'
list.html
'
,
...
...
@@ -38,6 +41,7 @@
});
mui
.
plusReady
(
function
()
{
if
(
mui
.
os
.
android
)
{
plus
.
screen
.
lockOrientation
(
"
portrait-primary
"
);
}
...
...
@@ -61,7 +65,6 @@
});
/**
* 显示侧滑菜单
*/
...
...
@@ -79,13 +82,11 @@
});
showMenu
=
true
;
});
}
}
/**
* 关闭菜单
*/
function
closeMenu
()
{
if
(
showMenu
)
{
//关闭遮罩;
...
...
@@ -114,8 +115,8 @@
}
});
//敲击顶部导航,内容区回到顶部
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
tap
'
,
function
()
{
main
.
children
()[
0
].
evalJS
(
'
window.scroll(0,
0)
'
);
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
double
tap
'
,
function
()
{
main
.
children
()[
0
].
evalJS
(
'
mui.scrollTo(0, 10
0)
'
);
});
//主界面向右滑动,若菜单未显示,则显示菜单;否则不做任何操作
window
.
addEventListener
(
"
swiperight
"
,
openMenu
);
...
...
@@ -141,9 +142,6 @@
if
(
subWebview
==
null
)
{
//获取共用父窗体
template
=
plus
.
webview
.
getWebviewById
(
"
default-main
"
);
//通知列表界面,已经开始点击;
var
list
=
plus
.
webview
.
currentWebview
().
children
()[
0
];
mui
.
fire
(
list
,
'
firstClick
'
,{});
}
if
(
template
){
subWebview
=
template
.
children
()[
0
];
...
...
@@ -177,7 +175,6 @@
}
}
}
};
</script>
</body>
...
...
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