swiper
Version:
Most modern mobile touch slider and framework with hardware accelerated transitions
19 lines (13 loc) • 442 B
JavaScript
import Utils from '../../../utils/utils';
export default function (axis = this.isHorizontal() ? 'x' : 'y') {
const swiper = this;
const {
params, rtlTranslate: rtl, translate, $wrapperEl,
} = swiper;
if (params.virtualTranslate) {
return rtl ? -translate : translate;
}
let currentTranslate = Utils.getTranslate($wrapperEl[0], axis);
if (rtl) currentTranslate = -currentTranslate;
return currentTranslate || 0;
}