模仿微信右上角菜单栏

页面的大致布局结构

<div class="other">
    <span>+</span>
    <ul class="tips-menu tips-open">
        <li>
            <span class="icon">图标</span>
            <div>发起群聊</div>
        </li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <div class="tips-masker"></div>
</div>

 相对应的样式

<style>
.other .tips-menu {
    position: absolute;
    z-index: 2;
    width: 133px;
    font-size: 16px;
    right: -10px;
    top: 54px;
    text-align: left;
    border-radius: 2px;
    background-color: #49484b;
    padding: 0 15px;
    -webkit-transform-origin: 90% 0;
    transform-origin: 90% 0;
}
.tips-open{
    transition: initial;
    opacity: 1;
}
.tips-close{
    opacity: 0;
    transition: opacity .2s ease,transform .6s ease;
    -webkit-transform: scale(0);
    transform: scale(0);
}
.other .tips-menu{ 
    width: 0;
    height: 0; 
    position: absolute; 
    top: -8px; 
    right: 15px;
    content: ""; 
    border-width: 0 6px 8px; 
    border-color: transparent transparent #49484b; 
    border-style: solid; 
} 
.other .tips-menu li {
    position: relative; 
    height: 40px; 
    line-height: 40px;
} 
.other .tips-menu .icon{ 
    float: left;
    margin-right: 15px; 
}
.other .tips-masker {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 1;
    top: 45px;
    bottom: 50px;
}
</style>

  

  具体根据实际情况作出相对应的改变

posted @ 2018-01-04 13:53  原叶  阅读(719)  评论(0编辑  收藏  举报