Home >Web Front-end >HTML Tutorial >How to build sidebar carousel and load animation with Ionic

How to build sidebar carousel and load animation with Ionic

一个新手
一个新手Original
2017-10-23 10:13:516250browse

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.)

1Install 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.

2Use the styles provided by the ionic framework for APP production--side sliding menu

## 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(&#39;todo&#39;, [&#39;ionic&#39;])

This enables the production of simple homepage and side menu.

3

Use the styles provided by the ionic framework for APP production--bottom tab

BLUE

YELLOW

PINK

<script> angular.module(&amp;#39;todo&amp;#39;, [&amp;#39;ionic&amp;#39;]) .controller("todo", function($scope, $timeout, $ionicLoading) { // 页面加载动画 $ionicLoading.show({ content: &#39;Loading&#39;, animation: &#39;fade-in&#39;, showBackdrop: true, maxWidth: 200, showDelay: 0 }); // 设置加载动画结束时间 $timeout(function() { $ionicLoading.hide(); $scope.stooges = [{ name: &#39;Moe&#39; }, { name: &#39;Larry&#39; }, { name: &#39;Curly&#39; }]; }, 400); 46 $scope.myActiveSlide = 0; }) </script>

2使用ionic框架提供的样式进行APP制作--图片轮播及加载动画

 

 

BLUE

YELLOW

PINK

<script> angular.module(&amp;#39;todo&amp;#39;, [&amp;#39;ionic&amp;#39;]) .controller("todo", function($scope, $timeout, $ionicLoading) { // 页面加载动画 $ionicLoading.show({ content: &#39;Loading&#39;, animation: &#39;fade-in&#39;, showBackdrop: true, maxWidth: 200, showDelay: 0 }); // 设置加载动画结束时间 $timeout(function() { $ionicLoading.hide(); $scope.stooges = [{ name: &#39;Moe&#39; }, { name: &#39;Larry&#39; }, { name: &#39;Curly&#39; }]; }, 400); 46 $scope.myActiveSlide = 0; }) </script>

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn