Rumah > hujung hadapan web > tutorial js > 用ionic实现无限轮播与点击跳转

用ionic实现无限轮播与点击跳转

一个新手
Lepaskan: 2017-09-19 10:39:06
asal
1616 orang telah melayarinya

第一页面

<!DOCTYPE html><html lang="en"><head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="../lib/css/ionic.css">
    <script src="../lib/js/ionic.bundle.min.js"></script>
    <script>
        var app = angular.module('myApp', ['ionic']);        
        app.config(function($stateProvider,$urlRouterProvider) {/*$urlRouterProvider*/            
        $stateProvider
                .state('home', {                   
                url: '/',                   
                 templateUrl: 'home.html'                
                 })
                .state('tiaozhuan', {                    
                url: '/tiaozhuan',                   
                templateUrl: 'tiaozhuan.html'                
                })
            $urlRouterProvider.otherwise("/")
        });    </script></head><body ng-app="myApp"><ion-nav-view animation="slide-left-right">
    <!-- 中间内容 --></ion-nav-view></body></html>
Salin selepas log masuk

第二页面<!DOCTYPE html><html lang="en"><head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="../lib/css/ionic.min.css">
    <script src="../lib/js/ionic.bundle.min.js"></script>
    <style>
        img{            
        width: 100%;            
        height: auto;
        }
        .btn{            
        background: green;            
        position: fixed;            
        left: 40%;            
        bottom: 100px;
        }    
    </style>
    <script>
        var my=angular.module("my",["ionic"]);    
        </script></head><body ng-app="my">
        <!-- ion-view的标题会在导航栏显示 -->
        <ion-view title="Tiaozhuan">
    <ion-content>
        <ion-nav-view animation="slide-left-right">
            <ion-slide-box auto-play="true" does-continue="true" slide-interval="1500">
                <ion-slide>
                    <p class="box blue"><img src="../img/start_page-01.jpg" height="1334" width="750"/></p>
                </ion-slide>
                <ion-slide>
                    <p class="box yellow"><img src="../img/start_page-02.jpg" height="1334" width="750"/></p>
                </ion-slide>
                <ion-slide on-slide-changed="slideHasChanged(index)">
                    <p class="box pink">
                        <img src="../img/start_page-03.jpg" height="1334" width="750"/>
                        <button class="button button-balanced btn" ui-sref="tiaozhuan">点击进入</button>
                    </p>
                </ion-slide>
            </ion-slide-box>
        </ion-nav-view>
    </ion-content></ion-view>
    </body>
    </html>
    
    
第三页面
<!-- ion-view的标题会在导航栏显示 --><ion-view title="Tiaozhuan">
 <ion-content>
 <p>asdas</p>
 </ion-content></ion-view>
Salin selepas log masuk

Atas ialah kandungan terperinci 用ionic实现无限轮播与点击跳转. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan