前言
先來張圖,仿微信界面,界面如下,并不完全一模一樣,只能說有些類似,希望大家見諒。
1 用到的知識(shí)點(diǎn)
jQuery WeUI 是WeUI的一個(gè)jQuery實(shí)現(xiàn)版本,除了實(shí)現(xiàn)了官方插件之外,它還提供了如下拉刷新、日歷、地址選擇器等豐富的拓展組件。jQuery WeUI 中的JS組件均是以JQuery 插件的形式提供,使用非常方便,并且可以和React、Angular、VUE之類的主流JS框架一起使用。
WeUI 是微信官方團(tuán)隊(duì)針對(duì)微信提供的一個(gè)H5 UI庫,它只提供了一組CSS組件。jQuery WeUI 中使用的是官方WeUI的CSS代碼,并提供了jQuery/Zepto版本的API實(shí)現(xiàn)。因?yàn)橹苯邮褂昧斯俜降腃SS,所以你不用擔(dān)心跟官方版本的沖突。實(shí)際上 jQuery WeUI == WeUI + jQuery插件。
Font Awesome 是一套完美的圖標(biāo)字體,主要目的是和 Bootstrap 搭配使用。
2 引入樣式文件
<link href="static/lib/weui.css" rel="stylesheet" type="text/css" /> <link href="static/css/jquery-weui.css" rel="stylesheet" type="text/css" /> <link href="static/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css" />
3 先說底部菜單
<div class="weui-tabbar"> <a href="wx-wx.html" class="weui-tabbar__item "> <span class="weui-badge" style="position: absolute;top: -.4em;right: 1em;">8</span> <div class="weui-tabbar__icon"> <i class="fa fa-comment-o fa-fw" style=" "></i> </div> <p class="weui-tabbar__label">微信</p> </a> <a href="wx-tongxulv.html" class="weui-tabbar__item"> <div class="weui-tabbar__icon"> <i class="fa fa-vcard-o" style=" "></i> </div> <p class="weui-tabbar__label">通訊錄</p> </a> <a href="#tab3" class="weui-tabbar__item"> <div class="weui-tabbar__icon"> <i class="fa fa-compass " style=""></i> </div> <p class="weui-tabbar__label">發(fā)現(xiàn)</p> </a> <a href="wx-user.html" class="weui-tabbar__item weui-bar__item--on"> <div class="weui-tabbar__icon"> <i class="fa fa-user" style=" color:#0dba08;"></i> </div> <p class="weui-tabbar__label" style=" color:#0dba08;">我</p> </a> </div>
4 頭部代碼
<nav class="blue nav" style=" "> <a id="topPopovershow" href="#" class="button button-link right "> <i class="fa fa-plus fa-fw" style=" font-size:20px;" ></i> </a> <h1 class="title">微信</h1> </nav>
5 主體部分
<div class="page-content"> <div class="weui-cells" style="margin-top: 0px;"> <a class="weui-cell weui-cell_access open-popup weui-popup-modal " data-target="#full" href="javascript:;"> <div class="weui-cell__hd"> <img width="48px;" class="weui-media-box__thumb" src="images/timg5.jpg" alt="" class="self-header"> </div> <div class="weui-cell__bd"> <div style=" margin-left:10px;"> <h4 class="weui-media-box__title">小樓聽春雨菩提本無樹</h4> <p class="weui-media-box__desc" >菩提本無樹,明鏡</p> </div> </div> <div class="weui-cell__ft">22:55</div> </a> <a class="weui-cell weui-cell_access" href="javascript:;"> <div class="weui-cell__hd"> <img width="48px;" class="weui-media-box__thumb" src="images/timg2.jpg" alt="" class="self-header"> </div> <div class="weui-cell__bd"> <div style=" margin-left:10px;"> <h4 class="weui-media-box__title">聽春雨</h4> <p class="weui-media-box__desc" >大家聊聊天今天下雨了</p> </div> </div> <div class="weui-cell__ft">22:55</div> </a> </div>
6 頭部css
.nav { position: fixed; right: 0; left: 0; z-index: 10; height: 2.2rem; padding-right: .5rem; padding-left: .5rem; background-color: #0993c7; -webkit-backface-visibility: hidden; backface-visibility: hidden; color: #FFF; background-color: #20a0ff; }
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
標(biāo)簽:大同 泰州 萍鄉(xiāng) 保定 延邊 林芝 赤峰
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《H5仿微信界面教程(一)》,本文關(guān)鍵詞 ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。