You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
566 B
21 lines
566 B
|
3 years ago
|
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");
|
||
|
|
})
|
||
|
|
});
|
||
|
|
}
|