1

It seems a very z-index issue, but I am not able to get a solution. I am trying to get an element in ion-view to come above $ionicBackdrop.

Example Pen: http://codepen.io/ankitjain11/pen/grwZav

JS:

angular.module('myApp', ['ionic'])

  .controller('IonicBackdropCtrl', function($scope, $ionicBackdrop, $timeout) {

  $scope.show = function() {
    $scope.back = true;
    $ionicBackdrop.retain();
  };
  $scope.hide = function () {
        $scope.back = false;
    $ionicBackdrop.release();
  }

});

HTML:

  <body ng-controller="IonicBackdropCtrl">
    <ion-view>
      <ion-content>
        <button class="button" ng-click="show()">
          Show Backdrop
        </button>
        <button class="button" ng-click="hide()" ng-show="back">
          Hide Backdrop
        </button>
      </ion-content>
    </ion-view>
  </body>

Here, the Hide Backdrop button, would come over the backdrop. Once, the backdrop is visible.

Though, my implementation is not as straight forward as the Pen, but still would serve my purpose.

Jamie Eltringham
  • 810
  • 3
  • 16
  • 25
ankitjain11
  • 253
  • 2
  • 16

1 Answers1

1

Here is a discussion about same problem. And there is workaround for what you want as described in this discussion. Make the buttons direct child of body and then z-index changing would work. Look here http://codepen.io/anon/pen/EKNvrZ

Olga Akhmetova
  • 490
  • 1
  • 6
  • 19