UNPKG

swiper

Version:

Most modern mobile touch slider and framework with hardware accelerated transitions

15 lines 545 B
export default function setGrabCursor(moving) { const swiper = this; if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; if (swiper.isElement) { swiper.__preventObserver__ = true; } el.style.cursor = 'move'; el.style.cursor = moving ? 'grabbing' : 'grab'; if (swiper.isElement) { requestAnimationFrame(() => { swiper.__preventObserver__ = false; }); } }