Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Z-indexing on ionic elements

I'm developping a mobile/web app with Ionic Framework. I'm using a custom CSS header and a ion-slide-box, customized the pager but want it to overlap with this custom header.

I tried everything with positioning and z-index, but I can't manage to show the pager over the CSS shape.

The Code:

.bandeau
{
  position: relative;
  top: 0;
  height: 70px;
  width: 100%;
  background-color: #555555;
  margin-bottom: 80px;
}
.oval {
  -moz-border-radius: 100px / 50px;
  -webkit-border-radius: 100px / 50px;
  border-radius: 60% / 30px;
  position: absolute;
  height: 100px;
  width: 100%;
  top: 60%;
  background-color: #555555;
}
.slider-pager {
  display: block;
  background-color: white;
  position: absolute;
  z-index: 1000;
  top: -30px;
  height: 48px;
}
.slider-pager .slider-pager-page {
  position: relative;
  background-color: gray;
  border-radius: 100%;
  max-width: 72px;
  width: 48px;
  z-index: 10;
  height: 100%;
}
.pager-image {
  width: 100%;
}
.slider {
  height: 100%;
  background-color: white;
}
.ion-slide {
  background-color: white;
}
<div class="bandeau">
  <div class="oval"></div>
</div> <!-- TODO -->
<ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>

<ion-view view-title="Catspads" align-title="left">
  <ion-slide-box show-pager="true">
    <ion-slide>
      <ion-content>

Screenshot (here the pager won't be over the header):
Here the pager won't be over the header.

like image 219
Maxime B Avatar asked Mar 02 '26 06:03

Maxime B


1 Answers

The only way I found to get rid of this was to programatically move the pager using JS to an upper HTML level, positionning it out of the ion-content tag. z-index worked as intended, but couldn't find a cleaner solution for this.

like image 144
Maxime B Avatar answered Mar 04 '26 21:03

Maxime B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!