css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

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

    <title>Ionic Fullscreen Image with Slide Box</title>
  
  </head>
  <body ng-app="ionicApp">
    <ion-view ng-controller="MainCtrl">
      
      <div class="bar bar-header bar-positive">
          <h1 class="title">Header</h1>
      </div>
      
      <ion-content class="has-header">
          <button ng-click="toggle=!toggle" ng-init="toggle=true">Click Me to TOGGLE</button>
          <div ng-if="toggle" class="card animacion">
              TEST
          </div>
          <div ng-if="!toggle" class="modal image-modal transparent animacion">
            <button>TESA</button>
            <button>TESB</button>
            <ion-slide-box on-slide-changed="slideChanged(index)" show-pager="false">
                <ion-slide ng-repeat="oImage in aImages">
                    <img ng-src="{{oImage.src}}" class="fullscreen-image" />
                    <p class="info">{{oImage.msg}}</p>
                </ion-slide>
            </ion-slide-box>
          </div>
          
        
        </ion-content>
        
        <div class="bar bar-footer bar-balanced">
          <div class="title">Footer</div>
        </div>
      
    </ion-view>
  </body>
</html>
            
          
!
            
              .transparent {
  background: transparent !important;
}
.image-modal {
  width: 100% !important;
  height: 100%;
  top: 28px !important;
  left: 0 !important;
}
.fullscreen-image {
  max-width: 100%;
  max-height: 100%;
  bottom: 0;
  left: 0;
  margin: auto;
  overflow: auto;
  position: fixed;
  right: 0;
  top: 0;
}
.slider {
  width: 100%;
  height: 100%;
}

p.info {
  position: absolute;
  bottom: 55px;
  margin: 0 auto;
  width: 100%;
  display: block;
  text-align: center;
  font-size: 28px;
  color: #ffffff;
}

/* Fix modal backdrop for smaller devices */
@media (max-width: 679px) {
  .active .modal-backdrop-bg {
    opacity: .5;
  }
  .modal-backdrop-bg {
    -webkit-transition: opacity 300ms ease-in-out;
    transition: opacity 300ms ease-in-out;
    background-color: #000;
    opacity: 0;
  }
}

.animacion.ng-enter {
    -webkit-animation: zoomIn 1s;
    -moz-animation: zoomIn 1s;
    -ms-animation: zoomIn 1s;
    animation: zoomIn 1s;
}

.animacion.ng-leave {
    -webkit-animation: zoomOut 5s;
    -moz-animation: zoomOut 5s;
    -ms-animation: zoomOut 5s;
    animation: zoomOut 5s;
}

            
          
!
            
              angular.module('ionicApp', ['ionic','ngAnimate'])

.controller('MainCtrl', ['$scope', '$ionicModal', '$ionicSlideBoxDelegate', function ($scope, $ionicModal, $ionicSlideBoxDelegate) {
		
  	$scope.aImages = [{
      	'src' : 'https://ionicframework.com/img/ionic-logo-blog.png', 
      	'msg' : 'Swipe me to the left. Tap/click to close'
    	}, {
        'src' : 'https://ionicframework.com/img/ionic_logo.svg', 
        'msg' : ''
      }, { 
        'src' : 'https://ionicframework.com/img/homepage/phones-weather-demo@2x.png', 
        'msg' : ''
    }];
  
    $ionicModal.fromTemplateUrl('image-modal.html', {
      scope: $scope,
      animation: 'slide-in-up'
    }).then(function(modal) {
      $scope.modal = modal;
    });

    $scope.openModal = function() {
      $ionicSlideBoxDelegate.slide(0);
      $scope.modal.show();
    };

    $scope.closeModal = function() {
      $scope.modal.hide();
    };

    // Cleanup the modal when we're done with it!
    $scope.$on('$destroy', function() {
      $scope.modal.remove();
    });
    // Execute action on hide modal
    $scope.$on('modal.hide', function() {
      // Execute action
    });
    // Execute action on remove modal
    $scope.$on('modal.removed', function() {
      // Execute action
    });
    $scope.$on('modal.shown', function() {
      console.log('Modal is shown!');
    });

    // Call this functions if you need to manually control the slides
    $scope.next = function() {
      $ionicSlideBoxDelegate.next();
    };
  
    $scope.previous = function() {
      $ionicSlideBoxDelegate.previous();
    };
  
  	$scope.goToSlide = function(index) {
      $scope.modal.show();
      $ionicSlideBoxDelegate.slide(index);
    }
  
    // Called each time the slide changes
    $scope.slideChanged = function(index) {
      $scope.slideIndex = index;
    };
  }
]);
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console