Skip to content

Instantly share code, notes, and snippets.

@cold-coder
Last active January 7, 2016 14:09
Show Gist options
  • Save cold-coder/92d7a8b7fc41bd4251a7 to your computer and use it in GitHub Desktop.
Save cold-coder/92d7a8b7fc41bd4251a7 to your computer and use it in GitHub Desktop.
WeChat UI Preview
<!doctype html>
<html>
<head>
<link href="style.css" rel="stylesheet">
<script src="./jquery-1.11.3.js"></script>
<script src="./jquery-ui.js"></script>
</head>
<body >
<div class="mobile_menu_preview">
<div class="mobile_hd">Tiny Toufu</div>
<div class="mobile_bd">
<ul class="pre_menu_list grid_line sortable">
<li class="pre_menu_item size1of3 jsMenu jslevel1">
<a href="javascript:void(0);" class="pre_menu_link">
<i class="icon_menu_dot"></i>
<i class="icon20_common sort_gray"></i>
<span>菜单1</span>
</a>
<div class="sub_pre_menu_box js_l2TitleBox">
<ul class="sub_pre_menu_list sub_sortable">
<li>
<a href="javascript:void(0);">
<span class="sub_pre_menu_inner">
<i class="icon20_common sort_gray"></i>
<span>子菜单1</span>
</span>
</a>
</li>
<li>
<a href="javascript:void(0);">
<span class="sub_pre_menu_inner">
<i class="icon20_common sort_gray"></i>
<span>子菜单2</span>
</span>
</a>
</li>
<li>
<a href="javascript:void(0);">
<span class="sub_pre_menu_inner">
<i class="icon20_common sort_gray"></i>
<span>子菜单3</span>
</span>
</a>
</li>
</ul>
<i class="arrow arrow_out"></i>
<i class="arrow arrow_in"></i>
</div>
</li>
<li class="pre_menu_item size1of3 jsMenu jslevel1">
<a href="javascript:void(0);" class="pre_menu_link">
<i class="icon_menu_dot"></i>
<i class="icon20_common sort_gray"></i>
<span>菜单2</span>
</a>
</li>
<li class="pre_menu_item size1of3 jsMenu jslevel1">
<a href="javascript:void(0);" class="pre_menu_link">
<i class="icon_menu_dot"></i>
<i class="icon20_common sort_gray"></i>
<span>菜单3</span>
</a>
</li>
</ul>
</div>
</div>
<script>
$(function() {
$( ".sortable" ).sortable({
axis:"x",
items:".jsMenu",
placeholder:"menu_drag_placeholder",
dropOnEmpty:!0,
start:function(e,t){
t.item.addClass("dragging") },
stop:function(e,t){
t.item.removeClass("dragging");
}
});
$( ".sub_sortable" ).sortable({
axis:"y",
items:".jsMenu",
placeholder:"menu_drag_placeholder",
dropOnEmpty:!0,
start:function(e,t){
t.item.addClass("dragging") },
stop:function(e,t){
t.item.removeClass("dragging");
}
});
});
</script>
</body>
</html>
body {
line-height: 1.6;
font-family: "Helvetica Neue","Hiragino Sans GB","Microsoft YaHei","\9ED1\4F53",Arial,sans-serif;
color: #222;
font-size: 14px;
background: #FFF;
}
ul, ol {
list-style-type: none;
margin: 0;
padding-left: 0;
}
.size1of3 {
width: 33.3%;
}
.size1of4{
width:25%;
}
.mobile_menu_preview {
position: relative;
width: 317px;
height: 580px;
background: transparent url(./bg_mobile_head_default.png) no-repeat 0 0;
border: 1px solid #e7e7eb;
}
.mobile_menu_preview .mobile_hd {
color: #fff;
text-align: center;
padding-top: 30px;
font-size: 15px;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
margin: 0 30px;
}
.mobile_menu_preview .pre_menu_list {
position: absolute;
bottom: 0;
left: 0;
right: 0;
border-top: 1px solid #e7e7eb;
background: transparent url(./bg_mobile_foot_default.png) no-repeat 0 0 ;
padding-left: 43px;
display: inline-flex;
}
.mobile_menu_preview .pre_menu_item {
line-height: 50px;
text-align: center;
position: relative;
}
.mobile_menu_preview .pre_menu_item .pre_menu_link {
border-left: 1px solid #e7e7eb;
}
.mobile_menu_preview .pre_menu_item:first-child .pre_menu_link{
border-left-width: 0;
}
.pre_menu_item a {
display: block;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
color: #616161;
text-decoration: none;
}
.pre_menu_list .sort_gray {
display: inline-block;
margin-top: -4px;
}
.icon20_common.sort_gray {
background: url(./base.png) 0 -5809px no-repeat;
}
.icon20_common {
width: 20px;
height: 20px;
vertical-align: middle;
line-height: 100px;
overflow: hidden;
}
.ui-state-highlight {
background-color: red;
}
.menu_drag_placeholder{
float:left;
width:80px;
height:42px;
margin:3px;
border:1px solid #e7e7eb;
background-color:#fff
}
.pre_menu_item.dragging{
border:1px solid #e7e7eb;
background-color:#fafafa
}
.grid_line:after {
content: "\200B";
display: block;
height: 0;
clear: both;
}
.sub_pre_menu_box {
display: block;
position: absolute;
bottom: 60px;
background-color: #fafafa;
border-top-width: 0;
left: 0;
width: 100%;
border: 1px solid #d0d0d0;
}
.sub_pre_menu_box .arrow {
position: absolute;
left: 50%;
margin-left: -6px;
}
.sub_pre_menu_box .arrow_out {
bottom: -6px;
display: inline-block;
width: 0;
height: 0;
border-width: 6px;
border-style: dashed;
border-color: transparent;
border-bottom-width: 0;
border-top-color: #d0d0d0;
border-top-style: solid;
}
.sub_pre_menu_box .arrow_in {
bottom: -5px;
display: inline-block;
width: 0;
height: 0;
border-width: 6px;
border-style: dashed;
border-color: transparent;
border-bottom-width: 0;
border-top-color: #fafafa;
border-top-style: solid;
}
.sub_pre_menu_list li {
line-height: 44px;
border: 1px solid transparent;
margin: 0 -1px -1px;
}
.sub_pre_menu_list li:hover {
background-color: #eee;
border: 1px solid #d0d0d0;
line-height: 45px;
cursor: pointer;
}
.sub_pre_menu_list li:first-child {
border-top: 1px solid #d0d0d0;
}
.sub_pre_menu_list li a {
padding: 0 .5em;
}
.sub_pre_menu_list li:first-child .sub_pre_menu_inner {
border-top-width: 0;
}
.sub_pre_menu_inner {
display: block;
border-top: 1px solid #e7e7eb;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
cursor: pointer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment