You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set the fade effect on slide transitions - I assumed I set this in the script.js within the SliderImages component? Here's what I've got:
`import { buildRefs, getJSON } from '@/assets/scripts/helpers.js'
import Swiper from 'swiper'
import { Autoplay, A11y, EffectFade, Navigation } from 'swiper/modules'
import 'swiper/css'
import 'swiper/css/autoplay'
import 'swiper/css/a11y'
import 'swiper/css/effect-fade'
import 'swiper/css/navigation'
export default function (el) {
const refs = buildRefs(el)
const data = getJSON(el)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to set the fade effect on slide transitions - I assumed I set this in the script.js within the SliderImages component? Here's what I've got:
`import { buildRefs, getJSON } from '@/assets/scripts/helpers.js'
import Swiper from 'swiper'
import { Autoplay, A11y, EffectFade, Navigation } from 'swiper/modules'
import 'swiper/css'
import 'swiper/css/autoplay'
import 'swiper/css/a11y'
import 'swiper/css/effect-fade'
import 'swiper/css/navigation'
export default function (el) {
const refs = buildRefs(el)
const data = getJSON(el)
const swiper = initSlider(refs, data)
return () => swiper.destroy()
}
function initSlider (refs, data) {
const { options } = data
const config = {
modules: [Autoplay, A11y, EffectFade, Navigation],
a11y: options.a11y,
effect: 'fade',
roundLengths: true,
navigation: {
nextEl: refs.next,
prevEl: refs.prev
}
}
if (options.autoplay && options.autoplaySpeed) {
config.autoplay = {
delay: options.autoplaySpeed
}
}
return new Swiper(refs.slider, config)
}`
This isn't affecting things - do I need to do something else as well or have I just got this wrong?
Beta Was this translation helpful? Give feedback.
All reactions