国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

angularjs實現時間軸效果的示例代碼

2019-11-19 14:49:50
字體:
來源:轉載
供稿:網友

一 引入包

引入angular-timeline包。

下載地址:angular-timeline.zip

在index.html中引入

<link href="lib/angular-timeline/dist/angular-timeline.css" rel="external nofollow" rel="stylesheet"><script src="lib/angular-timeline/dist/angular-timeline.js"></script>

app.js中引用,不引用就沒有效果。


二 改寫css

根據需求改寫css,核心部分的改寫。

可以寫在style.css中,也可以新建一個css文件,但是一定要在index.html中引用。

/* 時間軸 */.timeline-event { margin-bottom: 0px !important;}timeline-badge.infos { background-color: #47d09e !important;}.timeline:before { width: 1px !important; left: 24px !important; margin-top: 30px !important; background-color: #47d09e !important;}timeline-badge { left: 16px !important; width: 15px !important; height: 15px !important; top: 15px !important; box-shadow: none !important;}timeline-panel { float: left !important; width: 85% !important; padding: 13px 0px 6px 0px !important; margin-left: 39px !important; background: none !important; border: none !important; box-shadow: none !important;}timeline-panel:before { visibility: hidden !important;}timeline-panel:after { visibility: hidden !important; display: none !important;}timeline-panel .time { font-size: 14px; font-family: 'PingFangSC-Regular';}timeline-panel .detail { display: flex; display: -webkit-flex; align-items: center; -webkit-align-items: center; justify-content: space-between; -webkit-justify-content: space-between; margin-top: 10px;}timeline-panel .detail .linename { font-size: 16px; max-width: 80%; color: #1c1c1c; display: inline-block; font-family: 'PingFangSC-Medium';}timeline-panel .detail .linelevel { position: absolute; right: 18%; border-radius: 4px; color: white; padding: 1px 5px 1px 5px; font-size: 11px;}timeline-panel .detail .linelevel-g { background-color: #f27373;}timeline-panel .detail .linelevel-p { background-color: #e29431;}timeline-panel .detail .linenum { float: right; font-size: 14px; color: #323232;}

三 頁面

準備工作做完了,下面是頁面的編寫。

<!--html頁面--><ion-view view-title="{{title}}"> <ion-content scroll="true">  <timeline>   <timeline-event ng-repeat="event in teamDataList" side="right">    <timeline-badge class="infos">    </timeline-badge>    <timeline-panel class="infos">       <span class="time">        {{event.hour}}       </span>     <div class="detail" ng-repeat="item in event.data">      <span class="linename">{{item.customerName}}</span>      <div style="float: right;">         <span class="linenum">         {{item.reserveNumber}}人         </span>      </div>     </div>    </timeline-panel>   </timeline-event>  </timeline> </ion-content></ion-view>
//controllerangular.module('studyApp.controllers') .controller('TimeLineCtrl', function ($scope, $rootScope, $location) {  $scope.title = '時間軸';  makeData();  function makeData() {   $scope.teamDataList=[    {     hour:"12:00",     data:[      {       customerName:"中國國旅(江蘇)國際旅行社有限公司",       reserveNumber:"12",       id:"aaaabbb12112"      },      {       customerName:"江蘇2",       reserveNumber:"122",       id:"aaaabbb12112"      }     ]    },    {     hour:"13:00",     data:[{      customerName:"江蘇2",      reserveNumber:"112",      id:"aaaabbb12112"     }]    },    {     hour:"14:00",     data:[{      customerName:"江蘇3",      reserveNumber:"12",      id:"aaaabbb12112"     }]    },    {     hour:"13:00",     data:[{      customerName:"江蘇2",      reserveNumber:"112",      id:"aaaabbb12112"     }]    },    {     hour:"14:00",     data:[{      customerName:"江蘇3",      reserveNumber:"12",      id:"aaaabbb12112"     }]    }   ];  } });

四 效果圖

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 五家渠市| 麻阳| 岳普湖县| 武山县| 胶南市| 岳阳市| 长春市| 马公市| 随州市| 贵南县| 邹平县| 富宁县| 奎屯市| 镇巴县| 平利县| 仙居县| 西畴县| 沂源县| 墨竹工卡县| 成都市| 永年县| 丽水市| 孝昌县| 玛纳斯县| 依兰县| 陵水| 兰溪市| 潼南县| 丹寨县| 沾益县| 沙坪坝区| 和静县| 福建省| 富源县| 东阳市| 永平县| 永平县| 施甸县| 马尔康县| 隆德县| 景洪市|