Home > Article > Web Front-end > How to build sidebar carousel and load animation with Ionic
Super easy-to-use mobile framework--Ionic
Ionic is a lightweight mobile UI library with the characteristics of fast speed, modern interface and beautiful appearance.
In order to solve the problem of some other UI libraries running slowly on mobile phones, it directly gave up support for versions below IOS6 and Android4.1 to obtain a better user experience.
(Recently I am learning about mobile project production. This article briefly illustrates some of the learned styles on the use of Ionic.)
##1.HBuilder creates an APP project and imports ionic’s css. js (fonts) files.
##2.Import the ionic.css and ionic.bundle.js files.
## 1.HTML code
<body ng-app="todo"> <ion-side-menus> <!-- 中心内容 --> <ion-side-menu-content> <ion-header-bar class="bar-dark"> <h1 class="title">Ionic</h1> </ion-header-bar> <ion-content> <p class="list card"> <p class="item item-avatar"> <img src="../img/222.jpg"/> <h2>Ionic Demo</h2> <p>LJY</p> </p> <p class="item item-image"> <img src="../img/28.jpg"> </p> <a class="item assertive" href="#"> Try Ionic </a></p> </ion-content> </ion-side-menu-content> <!-- 左侧菜单 --> <ion-side-menu side="left"> <ion-header-bar class="bar-dark"> <h1 class="title">Projects</h1> </ion-header-bar> <p class="list"> <p class="item item-pider"> 这是左侧菜单 </p> <a class="item" href="#"> This is page1 </a><a class="item" href="#"> This is page2 </a><a class="item" href="#"> This is page3 </a></p> </ion-side-menu> </ion-side-menus><script type="text/javascript" src="../js/app.js"></script> </body>
2.js
angular.module('todo', ['ionic'])
This enables the production of simple homepage and side menu.
<script> angular.module(&#39;todo&#39;, [&#39;ionic&#39;]) .controller("todo", function($scope, $timeout, $ionicLoading) { // 页面加载动画 $ionicLoading.show({ content: 'Loading', animation: 'fade-in', showBackdrop: true, maxWidth: 200, showDelay: 0 }); // 设置加载动画结束时间 $timeout(function() { $ionicLoading.hide(); $scope.stooges = [{ name: 'Moe' }, { name: 'Larry' }, { name: 'Curly' }]; }, 400); 46 $scope.myActiveSlide = 0; }) </script>BLUE
YELLOW
PINK
<script> angular.module(&#39;todo&#39;, [&#39;ionic&#39;]) .controller("todo", function($scope, $timeout, $ionicLoading) { // 页面加载动画 $ionicLoading.show({ content: 'Loading', animation: 'fade-in', showBackdrop: true, maxWidth: 200, showDelay: 0 }); // 设置加载动画结束时间 $timeout(function() { $ionicLoading.hide(); $scope.stooges = [{ name: 'Moe' }, { name: 'Larry' }, { name: 'Curly' }]; }, 400); 46 $scope.myActiveSlide = 0; }) </script>BLUE
YELLOW
PINK
The above is the detailed content of How to build sidebar carousel and load animation with Ionic. For more information, please follow other related articles on the PHP Chinese website!