zhuguifei
2025-07-04 186d172fc06dfe44dc2a61d238356e6a7db652d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export default function WillChange({
    swiper,
    extendParams,
    on
}) {
    on('setTransition', (s, duration) => {
        if (!swiper.params.willChange) return;
        if (swiper.params.effect == "slide" || swiper.params.effect == "cube" || swiper.params.effect ==
            "coverflow" || swiper.params.effect == "panorama") {
            swiper.$wrapperEl.willChange("transform");
        }
    });
    on('transitionEnd', (s, duration) => {
        if (!swiper.params.willChange) return;
        swiper.$wrapperEl.willChange("auto");
        swiper.slides.forEach((item) => {
            item.$itemEl.willChange("auto");
        })
    });
}