效果如下图所示,`creativeEffect`里面设置了`opacity`为0.8,但是现在最底层的透明度还是没有变,想要的效果是除了中间的色块,其他色块元素透明度都是0.8,这种要怎么改?  swiper叠加轮播图 body { display: flex; align-items: center; justify-content: center; } /* 外层容器 */ .swiper { width: 1310px; height: 482px; } .swiper-wrapper { width: 1216px; height: 482px; } /* 轮播项 */ .swiper .swiper-slide { width: 387px; height: 482px; font-size: 32px; font-weight: 500; color: #ffffff; /* 文字垂直居中 */ display: flex; justify-content: center; align-items: center; /* opacity: 0.5 !important; */ } .swiper .swiper-slide-active { /* opacity: 1 !important; */ } /* 色彩来源:https://color.uisdc.com/ */ .swiper .swiper-slide-1 { background-color: #425066; } .swiper .swiper-slide-2 { background-color: #b88ed6; } .swiper .swiper-slide-3 { background-color: #9d2933; } .swiper .swiper-slide-4 { background-color: #003371; } .swiper .swiper-slide-5 { background-color: #4c8dae; } .swiper .swiper-slide-6 { background-color: #72db09; } .swiper .swiper-slide-7 { background-color: #f72905; } .swiper .swiper-slide-8 { background-color: #03a8fb; } .swiper .swiper-slide-9 { background-color: #9803fb; } /* .swiper-button-prev { width: 34px; height: 34px; background: url("./img/prev.png") no-repeat; background-size: 100% 100%; } .swiper-button-next { width: 34px; height: 34px; background: url("./img/next.png") no-repeat; background-size: 100% 100%; } 去除默认的操作按钮样式 .swiper-button-next:after, .swiper-button-prev:after { display: none; } */ 1 2 3 4 5 6 7 8 9 --> const swiper = new Swiper('.swiper', { //默认第几个在中心位置显示,总数量中间的一个,计算 initialSlide: 2, autoplay: false, slidesPerView: "3", centeredSlides: true, effect: "creative", loop: true, grabCursor: true, creativeEffect: { prev: { translate: ['-40%', 0, 0], // 偏移量 origin: "center center", scale: 0.85, // 缩放量 opacity: 0.8, shadow: true, // 是否加阴影 }, next: { translate: ['40%', 0, 0], origin: "center center", scale: 0.85, opacity: 0.8, shadow: true, }, limitProgress: 2, // 显示五个堆叠的最重要的这个属性,后面依次以前面属性等比配置 shadowPerProgress: true, //是否等比配置透明度 }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); // 监听改变事件 swiper.on('slideChange', (e) => { console.log(e.realIndex); });