A Pen by Scott Whittaker on CodePen.
Created
September 16, 2015 18:25
-
-
Save davidmaogomezz/8487088296a95a15a725 to your computer and use it in GitHub Desktop.
Ionic Slide Box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html ng-app="app"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | |
<title>Ionic Slide Box</title> | |
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> | |
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> | |
</head> | |
<body> | |
<ion-header-bar class="bar bar-header bar-calm"> | |
<h2 class="title">Slide Box</h2> | |
</ion-header-bar> | |
<ion-content scroll="false"> | |
<div ng-controller="SlideBoxController as vm"> | |
<ion-slide-box show-pager="true" on-slide-changed="vm.onSlideChanged($index)"> | |
<ion-slide ng-repeat="item in vm.items"> | |
<div class="box"> | |
<h2>{{item.title}}</h2> | |
<p>{{item.desc}}</p> | |
</div> | |
</ion-slide> | |
</ion-slide-box> | |
</div> | |
</ion-content> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app', ['ionic']) | |
.controller('SlideBoxController', function() { | |
var vm = this; | |
vm.items = [ | |
{title: 'Item 1', desc: 'This is item 1'}, | |
{title: 'Item 2', desc: 'This is item 2'}, | |
{title: 'Item 3', desc: 'This is item 3'} | |
]; | |
vm.onSlideChanged = function(slideIndex) { | |
// Do something when slide changes | |
}; | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.slider { | |
height: 300px; | |
background-color: #eee; | |
} | |
.box { | |
padding: 1em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment