手机端通讯录制作,字母索引查找

首先先引入 flexible.js 手机端人适配,引入jquery插件,引入 jquery.charfirst.pinyin,js获取第一个汉字首字母

 

HTML部分内容

sort.css部分

 

sort。css的部分代码

#letter{

    width: 100px;

    height: 100px;

    border-radius: 5px;

    font-size: 75px;

    color: #555;

    text-align: center;

    line-height: 100px;

    background: rgba(145,145,145,0.6);

    position: fixed;

    left: 50%;

    top: 50%;

    margin:-50px 0px 0px -50px;

    z-index: 99;

    display: none;

    font-family: PingFangSC-Medium;

}

#letter img{

    width: 50px;

    height: 50px;

    float: left;

    margin:25px 0px 0px 25px;

}

.sort_box{

    width: 100%;

    overflow: hidden;

}

.sort_list{

    padding: .1rem .4rem 0;

    position: relative;

    height: 1.2rem;

    line-height: 1.2rem;

    background: #fff;

    color: #222;

    font-size: 16px;

    color: #000;

    box-sizing: content-box;

}

 

.sort_list .num_logo{

    width: 50px;

    height: 50px;

    border-radius: 10px;

    overflow: hidden;

    position: absolute;

    top: 5px;

    left: 20px;

}

.sort_list .num_name{

    color: #000;

    /*border-bottom: .5px solid #EBEBEB;*/

}

 

.sort_letter{

    height: .6rem;

    line-height: .6rem;

    padding-left: .4rem;

    color:#000;

    font-size: .28rem;

    /*border-bottom:1px solid #ddd;*/

}

.initials{

    position: fixed;

    display: inline-flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    top: 1rem;

    right: .3rem;

    height: 100%;

    width: 16px;

    padding-right: 0;

    text-align: center;

    font-size: 0.22rem;

    line-height: 0.32rem;

    font-family: PingFangSC-Medium;

    z-index: 99;

    background: transparent;

    color: #222;

}

.initials li+li{

    padding-top:0.04rem;

}

 

效果图:

请大佬帮助,我只是小白一只,只会使用有些地方还不是明白

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值