收藏
回答

swiper里面设置z-index对于外面标签无效问题?

swiper内部的z-index无论多大,都无法覆盖外部的标签。蓝色为1,其他都为100。

蓝色和tabbar是有效的。

wxml

<swiper style="height: {{clientHeight?clientHeight+'px':'auto'}}">
  <swiper-item>
    <view class="red">红色view>
  swiper-item>
  <swiper-item>
    <view class="green">绿色view>
  swiper-item>
  <view class="yellow">黄色view>
swiper>
<view class="blue">蓝色view>
<cpn-tabBar titles="{{titles}}" bind:titleClick="handleTitleClick"/>

css

.red {
  width100%;
  height500rpx;
  background-color: red;
  position: fixed;
  bottom0;
  left0;
  z-index100;
  
}
.green {
  width200rpx;
  height400rpx;
  background-color: green;
  position: fixed;
  bottom0;
  left0;
  z-index100;
}
.yellow {
  width100%;
  height300rpx;
  background-color: yellow;
  position: fixed;
  bottom0;
  left0;
  z-index100;
}
.blue {
  width100rpx;
  height300rpx;
  background-color: blue;
  position: fixed;
  bottom0;
  right0;
  z-index1;
}


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签