UNPKG

press-swiper

Version:

适配多端的高自定义轮播组件,多种3D效果。全面对标swiperjs。

24 lines (21 loc) 496 B
import { getTranslate } from '../../shared/utils.js'; export default function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') { const swiper = this; const { params, rtlTranslate: rtl, translate, $wrapperEl } = swiper; if (params.virtualTranslate) { return rtl ? -translate : translate; } if (params.cssMode) { return translate; } let currentTranslate = getTranslate(swiper, axis); if (rtl) currentTranslate = -currentTranslate; return currentTranslate || 0; }