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
7ef2ebe9
Commit
7ef2ebe9
authored
Sep 21, 2014
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加弹出菜单js说明
parent
d2bd5e7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
index.html
index.html
+4
-4
javascript/index.html
javascript/index.html
+25
-4
No files found.
index.html
View file @
7ef2ebe9
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-09-
19 18:04:16
+0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-09-
21 19:34:31
+0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-09-
19 18:04:16
+0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-09-
21 19:34:31
+0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
@@ -72,8 +72,8 @@
...
@@ -72,8 +72,8 @@
</ul>
</ul>
</div>
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-09-
19 18:04:16
+0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-09-
21 19:34:31
+0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-09-
19 18:04:16
+0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-09-
21 19:34:31
+0800"
></script>
</div>
</div>
</div>
</div>
...
...
javascript/index.html
View file @
7ef2ebe9
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-09-
19 18:04:16
+0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-09-
21 19:34:31
+0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-09-
19 18:04:16
+0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-09-
21 19:34:31
+0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
@@ -689,6 +689,27 @@ mui的解决思路是:单webview只承载单个页面的dom,减少dom层级
...
@@ -689,6 +689,27 @@ mui的解决思路是:单webview只承载单个页面的dom,减少dom层级
<span
class=
"nt"
>
<
div
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-slider-item
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
><
img
</span>
<span
class=
"na"
>
src=
</span><span
class=
"s"
>
"
1.jpg
"
</span>
<span
class=
"nt"
>
/
><
/a
><
/div
>
</span>
<span
class=
"nt"
>
<
div
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-slider-item
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
><
img
</span>
<span
class=
"na"
>
src=
</span><span
class=
"s"
>
"
1.jpg
"
</span>
<span
class=
"nt"
>
/
><
/a
><
/div
>
</span>
<span
class=
"nt"
>
<
/div
>
</span>
<span
class=
"nt"
>
<
/div
>
</span>
<span
class=
"nt"
>
<
/div
>
</span></code></pre></div>
<span
class=
"nt"
>
<
/div
>
</span></code></pre></div>
</article>
<!-- 弹出菜单 -->
<article
id=
"plugin-popover"
class=
"component mui-active"
>
<h3
class=
"component-title"
>
弹出菜单
</h3>
<p
class=
"component-description"
>
mui框架内置了弹出菜单插件,弹出菜单显示内容不限,但必须包裹在一个含
<code>
.mui-popover
</code>
类的div中,如下即为一个弹出菜单内容:
</p>
<div
class=
"highlight"
><pre><code
class=
"language-html"
data-lang=
"html"
><span
class=
"nt"
>
<
div
</span>
<span
class=
"na"
>
id=
</span><span
class=
"s"
>
"
popover
"
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-popover
"
</span><span
class=
"nt"
>
>
</span>
<span
class=
"nt"
>
<
ul
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-table-view
"
</span><span
class=
"nt"
>
>
</span>
<span
class=
"nt"
>
<
li
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-table-view-cell
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
>
</span>
Item1
<span
class=
"nt"
>
<
/a
><
/li
>
</span>
<span
class=
"nt"
>
<
li
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-table-view-cell
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
>
</span>
Item2
<span
class=
"nt"
>
<
/a
><
/li
>
</span>
<span
class=
"nt"
>
<
li
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-table-view-cell
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
>
</span>
Item3
<span
class=
"nt"
>
<
/a
><
/li
>
</span>
<span
class=
"nt"
>
<
li
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-table-view-cell
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
>
</span>
Item4
<span
class=
"nt"
>
<
/a
><
/li
>
</span>
<span
class=
"nt"
>
<
li
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-table-view-cell
"
</span><span
class=
"nt"
>
><
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#
"
</span><span
class=
"nt"
>
>
</span>
Item5
<span
class=
"nt"
>
<
/a
><
/li
>
</span>
<span
class=
"nt"
>
<
/ul
>
</span>
<span
class=
"nt"
>
<
/div
>
</span></code></pre></div>
<p
class=
"component-description"
>
要显示、隐藏如上菜单,mui推荐使用锚点方式,例如:
</p>
<div
class=
"highlight"
><pre><code
class=
"language-html"
data-lang=
"html"
><span
class=
"nt"
>
<
a
</span>
<span
class=
"na"
>
href=
</span><span
class=
"s"
>
"
#popover
"
</span>
<span
class=
"na"
>
class=
</span><span
class=
"s"
>
"
mui-btn mui-btn-primary mui-btn-block
"
</span><span
class=
"nt"
>
>
</span>
打开弹出菜单
<span
class=
"nt"
>
<
/a
>
</span></code></pre></div>
<p
class=
"component-description"
>
点击如上定义的按钮,即可显示弹出菜单,再次点击弹出菜单之外的其他区域,均可关闭弹出菜单;这种使用方式最为简洁。
</p>
<p
class=
"component-description"
>
若希望通过js的方式控制弹出菜单,则通过如下一个方法即可:
</p>
<div
class=
"highlight"
><pre><code
class=
"language-js"
data-lang=
"js"
><span
class=
"c1"
>
//传入toggle参数,用户也无需关心当前是显示还是隐藏状态,mui会自动识别处理;
</span>
<span
class=
"nx"
>
mui
</span><span
class=
"p"
>
(
</span><span
class=
"s1"
>
'
.mui-popover
'
</span><span
class=
"p"
>
).
</span><span
class=
"nx"
>
popover
</span><span
class=
"p"
>
(
</span><span
class=
"s1"
>
'
toggle
'
</span><span
class=
"p"
>
);
</span></code></pre></div>
</article>
</article>
<!-- Footer -->
<!-- Footer -->
...
@@ -708,8 +729,8 @@ mui的解决思路是:单webview只承载单个页面的dom,减少dom层级
...
@@ -708,8 +729,8 @@ mui的解决思路是:单webview只承载单个页面的dom,减少dom层级
</ul>
</ul>
</div>
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-09-
19 18:04:16
+0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-09-
21 19:34:31
+0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-09-
19 18:04:16
+0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-09-
21 19:34:31
+0800"
></script>
</div>
</div>
</div>
</div>
...
...
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