Reputation: 255
I have a "v-carousel" with a bunch of images, now i want to add a parallax effect on it (like "v-parallax").
<v-carousel cycle height="600" hide-delimiter-background show-arrows-on-hover>
<v-carousel-item v-for="(slide, i) in slides" :key="i" eager>
<v-img :src="slide.src" height="100%"/>
</v-carousel-item>
</v-carousel>
Upvotes: 0
Views: 484
Reputation: 1508
Check this codesandbox I made: https://codesandbox.io/s/stack-70665623-50fyk?file=/src/components/Example.vue
You mean something like this? If so, all you need to do is use a v-parallax
component instead of the v-img
inside your v-carousel-item
.
<v-carousel
cycle
height="400"
hide-delimiter-background
show-arrows-on-hover
>
<v-carousel-item
v-for="(slide, i) in slides"
:key="i"
eager
>
<v-parallax :src="slide.src"></v-parallax>
</v-carousel-item>
</v-carousel>
Upvotes: 1