orcaslicer/resources/web/guide/swiper/shared/create-shadow.js
lane.wei 1555904bef Add the full source of BambuStudio
using version 1.0.10
2022-07-15 23:42:08 +08:00

13 lines
No EOL
498 B
JavaScript

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;
}