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
c2ccb8fd
Commit
c2ccb8fd
authored
Feb 03, 2015
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hello mui支持“敲击顶部、回到顶部”功能
parent
07985561
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
examples/hello-mui/examples/template.html
examples/hello-mui/examples/template.html
+13
-2
examples/hello-mui/examples/template_pullrefresh.html
examples/hello-mui/examples/template_pullrefresh.html
+8
-0
examples/hello-mui/index.html
examples/hello-mui/index.html
+6
-4
No files found.
examples/hello-mui/examples/template.html
View file @
c2ccb8fd
...
@@ -92,8 +92,19 @@
...
@@ -92,8 +92,19 @@
menu
.
style
.
display
=
display
;
menu
.
style
.
display
=
display
;
});
});
document
.
getElementById
(
"
menu
"
).
addEventListener
(
'
tap
'
,
function
()
{
var
contentWebview
=
null
;
plus
.
webview
.
currentWebview
().
children
()[
0
].
evalJS
(
'
mui("#topPopover").popover("toggle")
'
);
document
.
getElementById
(
"
menu
"
).
addEventListener
(
'
tap
'
,
function
(
e
)
{
if
(
contentWebview
==
null
){
contentWebview
=
plus
.
webview
.
currentWebview
().
children
()[
0
];
}
contentWebview
.
evalJS
(
'
mui("#topPopover").popover("toggle")
'
);
});
//敲击顶部、回到顶部
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
tap
'
,
function
()
{
if
(
contentWebview
==
null
){
contentWebview
=
plus
.
webview
.
currentWebview
().
children
()[
0
];
}
contentWebview
.
evalJS
(
'
window.scroll(0, 0)
'
);
});
});
</script>
</script>
...
...
examples/hello-mui/examples/template_pullrefresh.html
View file @
c2ccb8fd
...
@@ -75,6 +75,14 @@
...
@@ -75,6 +75,14 @@
titleElem
.
innerHTML
=
title
;
titleElem
.
innerHTML
=
title
;
titleElem
.
className
=
"
mui-title mui-fadein
"
;
titleElem
.
className
=
"
mui-title mui-fadein
"
;
});
});
var
contentWebview
=
null
;
//敲击顶部、回到顶部
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
tap
'
,
function
()
{
if
(
contentWebview
==
null
){
contentWebview
=
plus
.
webview
.
currentWebview
().
children
()[
0
];
}
contentWebview
.
evalJS
(
'
window.scroll(0, 0)
'
);
});
</script>
</script>
</html>
</html>
\ No newline at end of file
examples/hello-mui/index.html
View file @
c2ccb8fd
...
@@ -21,7 +21,6 @@
...
@@ -21,7 +21,6 @@
</header>
</header>
<script>
<script>
var
menu
=
null
,
var
menu
=
null
,
list
=
null
,
main
=
null
;
main
=
null
;
var
showMenu
=
false
;
var
showMenu
=
false
;
mui
.
init
({
mui
.
init
({
...
@@ -58,8 +57,6 @@
...
@@ -58,8 +57,6 @@
aniShow
:
'
none
'
aniShow
:
'
none
'
}
}
});
});
},
200
);
},
200
);
});
});
...
@@ -108,12 +105,17 @@
...
@@ -108,12 +105,17 @@
}
}
}
}
//点击左上角侧滑图标,打开侧滑菜单;
//点击左上角侧滑图标,打开侧滑菜单;
document
.
querySelector
(
'
.mui-icon-bars
'
).
addEventListener
(
'
tap
'
,
function
()
{
document
.
querySelector
(
'
.mui-icon-bars
'
).
addEventListener
(
'
tap
'
,
function
(
e
)
{
e
.
stopPropagation
();
if
(
showMenu
)
{
if
(
showMenu
)
{
closeMenu
();
closeMenu
();
}
else
{
}
else
{
openMenu
();
openMenu
();
}
}
});
//敲击顶部导航,内容区回到顶部
document
.
querySelector
(
'
header
'
).
addEventListener
(
'
tap
'
,
function
()
{
main
.
children
()[
0
].
evalJS
(
'
window.scroll(0, 0)
'
);
});
});
//主界面向右滑动,若菜单未显示,则显示菜单;否则不做任何操作
//主界面向右滑动,若菜单未显示,则显示菜单;否则不做任何操作
window
.
addEventListener
(
"
swiperight
"
,
openMenu
);
window
.
addEventListener
(
"
swiperight
"
,
openMenu
);
...
...
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