ionic grid(柵格)九宮格制作詳解
更新時間:2018年06月30日 10:44:38 作者:kingcruel
這篇文章主要為大家詳細介紹了ionic grid九宮格的制作方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了ionic grid九宮格制作的具體代碼,供大家參考,具體內(nèi)容如下
1、Html
<ion-header-bar class="bar bar-header bar-light bar-calm"> <button class="button button-icon icon ion-navicon"></button> <ion-title class="bar-calm">騰訊新聞</ion-title> </ion-header-bar> <ion-content> <div class="row row-wrap"> <div class="col col-25" ng-repeat="item in items"> <img src="img/ionic.png" ng-click="alertClick({{item.text}})"> </div> </div> <br> <div class="row row-wrap"> <div class="col col-25" ng-repeat="item in items"> <p>{{item.text}}</p> </div> </div> <br> <div class="row row-wrap"> <div class="col col-25" ng-repeat="item in items"> <ul> <li> <img src="img/ionic.png" ng-click="alertClick({{item.text}})"> <p>{{item.text}}</p> </li> </ul> </div> </div> </ion-content>
2、Controller
appCntrollers.controller('ManageGridCtrl', function ($scope, $timeout, $ionicLoading) { $ionicLoading.show({ content: 'Loading', animation: 'fade-in', showBackdrop: true, maxWidth: 200, showDelay: 0 }); $timeout(function () { $ionicLoading.hide(); $scope.items = [ { id: 1, text: "111111" }, { id: 2, text: "222222" }, { id: 3, text: "333333" }, { id: 4, text: "444444" }, { id: 5, text: "555555" }, { id: 6, text: "666666" }, { id: 7, text: "777777" }, { id: 8, text: "888888" }, { id: 9, text: "999999" }, { id: 10, text: "aaaaaa" }, { id: 11, text: "bbbbbb" }, { id: 12, text: "cccccc" }, ]; }, 2000); $scope.alertClick = function (val) { alert(val); } })
3、Css
/* 柵格grid */ .col-25{border: 1px solid #ddd;height: 120px;display:flex;justify-content:center;align-items: center;} .col-25 img {height: 64px; width: 64px;} .col-25 ul li img {height: 64px; width: 64px;margin-top: 12px} .col-25 ul li p {text-align: center;}
4、效果圖
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
javascript中mouseover、mouseout使用詳解
這篇文章主要介紹了javascript中mouseover、mouseout使用詳解的相關(guān)資料,需要的朋友可以參考下2015-07-07JavaScript代碼輕松實現(xiàn)網(wǎng)頁內(nèi)容禁止復(fù)制(代碼簡單)
有些時候我們寫的內(nèi)容不想被別人復(fù)制,在代碼中怎么實現(xiàn)的呢?下面小編給大家介紹javascript代碼輕松實現(xiàn)網(wǎng)頁內(nèi)容禁止復(fù)制,感興趣的童鞋一起看看吧2015-10-10typeScript中數(shù)組類型定義及應(yīng)用詳解
相信大家應(yīng)該都知道ts只允許數(shù)組中包括一種數(shù)據(jù)類型的值,下面這篇文章主要給大家介紹了關(guān)于typeScript中數(shù)組類型定義及應(yīng)用的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下2023-05-05網(wǎng)頁開發(fā)中的容易忽略的問題 javascript HTML中的table
最近在搞在線電子表格這個東西,下面的是使用中的一些知識技巧。2009-04-04CocosCreator經(jīng)典入門項目之flappybird
這篇文章主要介紹了CocosCreator經(jīng)典入門項目之flappybird,詳細說明了制作的每個步驟,還有詳盡的代碼,對CocosCreator感興趣的同學,一定要看一下2021-04-04