cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

  <title>Ionic Tour</title>

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <link href="http://www.loringdodge.com/files/ionic.tour.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>

    <script src="https://code.ionicframework.com/collide/0.0.4/collide.js"></script>
  
    <script src="http://www.loringdodge.com/files/ionic.tour.js"></script>
  
<script id="tour-template.html" type="text/ng-template">
<tourtip>

  <tourtip-arrow></tourtip-arrow>
  <div class="button-bar">
    <button class="button" ng-click="next()">Next</button>
    <button class="button" ng-click="previous()">Previous</button>
  </div>

  <div class="button-bar">
<!--    <button class="button" ng-click="addStep()">AddStep</button>-->
    <button class="button" ng-click="finish()">Finish</button>
    <button class="button" ng-click="step(1)">Step(1)</button>
  </div>

  <div class="button-bar">
    <button class="button" ng-click="reset()">Reset</button>
    <button class="button" ng-click="removeStep(2)">RemoveStep(2)</button>
  </div>

</tourtip>

</script>

<script id="side-menu.html" type="text/ng-template">
<ion-side-menus enable-menu-with-back-views="false">
  <ion-side-menu-content>
    <ion-nav-bar class="bar-stable">
      <ion-nav-buttons side="left">
        <button class="button button-icon button-clear ion-navicon" menu-toggle="left">
        </button>
      </ion-nav-buttons>
    </ion-nav-bar>
    <ion-nav-view name="content"></ion-nav-view>
  </ion-side-menu-content>

  <ion-side-menu side="left">
    <ion-pane class="background-grey">

      <div class="button-bar padding">
        <a tour-step="3" tour-on-start="openSideMenu"  tour-on-leave="closeSideMenuPrevious" class="button">3</a>
      </div>

      <div class="button-bar padding">
        <a tour-step="4" tour-on-start="openSideMenu" tour-on-leave="closeSideMenu" class="button">4</a>
      </div>

    </ion-pane>
  </ion-side-menu>
</ion-side-menus>
</script>  
  
 <script id="home.html" type="text/ng-template">
  <ion-view view-title="Ionic Tour">
    <ion-pane>

      <ion-content>

        <div class="button-bar padding">
          <a class="button" ng-click="tour.start({autoplay: true})">Start</a>
        </div>

        <div class="button-bar padding">
          <a class="button"></a>
          <a class="button"></a>
          <a tour-step="1" tour-on-start="onStart" tour-on-end="onEnd" tour-on-transition="onTransition" tour-on-leave="onLeave" class="button">1</a>
        </div>

        <div class="button-bar padding">
          <a tour-step="2" tour-on-start="onStart" tour-on-end="onEnd" tour-on-transition="onTransition" tour-on-leave="onLeave" class="button">2</a>
        </div>

        <div class="button-bar padding">
          <a class="button"></a>
          <a tour-step="5" tour-on-start="onStart" tour-on-leave="onLeave" class="button">5</a>
        </div>

        <div class="button-bar padding">
          <a tour-step="10" tour-on-start="onStart" tour-on-leave="onLeave" class="button">10</a>
          <a class="button"></a>
          <a class="button"></a>
        </div>

        <div class="button-bar padding">
          <a tour-step="7" tour-on-start="onStart" tour-on-leave="onLeave" class="button">7</a>
        </div>

        <div class="button-bar padding">
          <a tour-step="6" tour-on-start="onStart" tour-on-leave="onLeave" class="button">6</a>
        </div>

        <div class="button-bar padding">
          <a class="button"></a>
          <a tour-step="9" tour-on-start="onStart" tour-on-leave="onLeave" class="button">9</a>
          <a class="button"></a>
        </div>

        <div class="button-bar padding">
          <a tour-step="8" tour-on-start="onStart" tour-on-leave="onLeave" class="button">8</a>
        </div>

      </ion-content>

    </ion-pane>
  </ion-view>
</script>
  
</head>

   <body ng-app="starter" ng-controller="MainCtrl">
    <ion-nav-view view-title="Ionic Tour"></ion-nav-view>
  </body>

</html>
            
          
!
            
              angular.module('starter', ['ionic', 'ionic.tour'])

.config(function($stateProvider, $urlRouterProvider) {
  $stateProvider

  .state('app', {
    url: "/app",
    abstract: true,
    templateUrl: "side-menu.html"
  })

  .state('app.home', {
    url: "/home",
    views: {
      'content': {
        templateUrl: "home.html"
      }
    }
  })

  // if none of the above states are matched, use this as the fallback
  $urlRouterProvider.otherwise('/app/home');
})

.controller('MainCtrl', function($scope, $ionicTour, $ionicSideMenuDelegate, $compile) {

  $ionicTour.fromTemplateUrl('tour-template.html', {
    scope: $scope
  }).then(function(tour){
    $scope.tour = tour;
  }).
  catch(function(err) {
    console.log(err)
  });

  $scope.next = function() {
    $scope.tour.next();
  }

  $scope.previous = function() {
    $scope.tour.previous();
  }

  $scope.finish = function() {
    $scope.tour.finish({
      destroy: false
    });
  }

  $scope.step = function(index) {
    $scope.tour.step(index);
  }

  $scope.reset = function() {
    $scope.tour.reset();
  }
  $scope.addStep = function() {
    var template = '<div class="button-bar padding"><a tour-step="11" tour-on-start="onStart" tour-on-leave="onLeave" class="button">11</a></div>';
    var el = $compile(template)($scope.tour.scope);

    var body = document.querySelector('.scroll');
    angular.element(body).append(el);
  console.log(body);
    $scope.tour.sort();
  }

  $scope.removeStep = function(index) {
    $scope.tour.removeStep(index);
  }
  $scope.onStart = function(element, tourtip) {
    angular.element(element).addClass('button-outline button-assertive')
  }

  $scope.onEnd = function(element, tourtip) {

  }

  $scope.onLeave = function(element, tourtip) {
    angular.element(element).removeClass('button-outline button-assertive')
  }

  $scope.onTransition = function(ratio) {

  }

  $scope.$on('tourAtStart', function(){

  })

  $scope.$on('tourAtEnd', function(){

  })

  $scope.openSideMenu = function(element, tourtip) {
    $ionicSideMenuDelegate.toggleLeft(true);
  }

  $scope.closeSideMenuPrevious = function(element, tourtip) {
    if($scope.tour._orientation !== 'next') {
      $ionicSideMenuDelegate.toggleLeft(false);
    }
  }

  $scope.closeSideMenu = function(element, tourtip) {
    $ionicSideMenuDelegate.toggleLeft(false);
  }


});


            
          
!
999px
Loading ..................

Console