Skip to content

Commit

Permalink
add action sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
sklme committed Oct 26, 2015
1 parent f5205d3 commit ea613c1
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/example/example.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion dist/example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,20 @@ $(function () {
$('#dialog2').find('.weui_btn_dialog').on('click', function () {
$('#dialog2').hide();
});
})
});
$container.on('click','#showActionSheet', function () {
var mask = $('#mask');
var weuiActionsheet = $('#weui_actionsheet');
weuiActionsheet.addClass('slideToggle');
mask.show();
$('#actionsheet_cancel').click(function () {
weuiActionsheet.removeClass('slideToggle');
weuiActionsheet.on('transitionend', function () {
mask.hide();
}).on('webkitTransitionEnd', function () {
mask.hide();
})
});
weuiActionsheet.unbind('transitionend').unbind('webkitTransitionEnd');
});
});
35 changes: 34 additions & 1 deletion dist/example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ <h1 class="page_title">WeUI</h1>
<div class="weui_cell_ft">
</div>
</a>
<a class="weui_cell js_cell" href="javascript:;" data-id="actionSheet">
<span class="weui_cell_hd"><img src="./images/icon_nav_article.png" class="icon_nav" alt=""></span>
<div class="weui_cell_bd weui_cell_primary">
<p>Action Sheet</p>
</div>
<div class="weui_cell_ft">
</div>
</a>
<a class="weui_cell js_cell" href="javascript:;" data-id="icons">
<span class="weui_cell_hd"><img src="./images/icon_nav_icons.png" class="icon_nav" alt=""></span>
<div class="weui_cell_bd weui_cell_primary">
Expand All @@ -75,7 +83,6 @@ <h1 class="page_title">WeUI</h1>
</div>
</div>
</div>
</div>
<script type="text/html" id="tpl_button">
<div class="page">
<div class="hd">
Expand Down Expand Up @@ -514,6 +521,32 @@ <h1 class="page_title">Icons</h1>
</div>
</div>
</script>
<script type="text/html" id="tpl_actionSheet">
<div class="page" style="overflow: hidden">
<div class="hd">
<h1 class="page_title">action sheet</h1>
</div>
<div class="bd spacing">
<a href="javascript:;" class="weui_btn weui_btn_primary" id="showActionSheet">点击上拉actionSheet</a>
</div>
<!--BEGIN actionSheet-->
<div id="actionSheet_wrap">
<div class="weui_mask" id="mask" style="display: none"></div>
<div class="weui_actionsheet" id="weui_actionsheet">
<div class="weui_actionsheet_menu">
<div class="weui_actionsheet_cell">示例菜单</div>
<div class="weui_actionsheet_cell">示例菜单</div>
<div class="weui_actionsheet_cell">示例菜单</div>
<div class="weui_actionsheet_cell">示例菜单</div>
</div>
<div class="weui_actionsheet_action">
<div class="weui_actionsheet_cell" id="actionsheet_cancel">取消</div>
</div>
</div>
</div>
<!--END actionSheet-->
</div>
</script>
<script src="https://res.wx.qq.com/open/libs/zepto/1.1.6/zepto.js"></script>
<script src="./example.js"></script>
</body>
Expand Down
49 changes: 48 additions & 1 deletion dist/style/weui.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/style/weui.min.css

Large diffs are not rendered by default.

0 comments on commit ea613c1

Please sign in to comment.