首頁  >  文章  >  web前端  >  用ionic實現無限輪播與點擊跳轉

用ionic實現無限輪播與點擊跳轉

一个新手
一个新手原創
2017-09-19 10:39:061569瀏覽

第一頁

<!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>

第二页面<!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>

以上是用ionic實現無限輪播與點擊跳轉的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
上一篇:關於使用NPM下一篇:關於使用NPM