UNPKG

swiper

Version:

Most modern mobile touch slider and framework with hardware accelerated transitions

13 lines (11 loc) 498 B
import $ from './dom.js'; export default function createShadow(params, $slideEl, side) { const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}`; const $shadowContainer = params.transformEl ? $slideEl.find(params.transformEl) : $slideEl; let $shadowEl = $shadowContainer.children(`.${shadowClass}`); if (!$shadowEl.length) { $shadowEl = $(`<div class="swiper-slide-shadow${side ? `-${side}` : ''}"></div>`); $shadowContainer.append($shadowEl); } return $shadowEl; }