background image transitions
Hey guys, i have a simple carousel that cycles through images whenever a button is clicked. One issue is, i'm unable to figure out why my images aren't performing a transition when switched from one to another. I'm using sveltekit with tailwind css
here is how my script tag looks like:
and my markup looks like this
when i click my "next" button for instance, it never performs any transition
7 Replies
https://developer.mozilla.org/en-US/docs/Web/CSS/background-image <-- it isn't animatable
well, it technically is, but it's just 0% -> 100%, no inbetween
what you can do is to use pseudo-elements positioned behind everything, and then you fade them based on whatever you want
by "fade" i mean that you transition the opacity
i'm a little confused, as per https://youtu.be/tXlZCW26bto?si=Puxcw1MaDd48632h at 5:20 how was he able to get the transition to work?
Code Commerce
YouTube
Build a React Image Slider with Tailwind CSS
Build an Image Slider component in React JS styled with Tailwind CSS.
ZeroTo Mastery:
Master React JS Course - https://bit.ly/Learn-React-JS
Complete Web Developer in 2023 - https://bit.ly/Complete-Web-Developer
💻 Solve EDABIT coding challenges - BEGINNER! 💻
https://bit.ly/Code-Challenges
🔥 Connect with me on IG 🔥
https://instagram.com/firecl...
¯\_(ツ)_/¯
i will watch later
You don’t have to watch the entire thing, it’s hardly a few seconds
i know, but im playing overwatch
Well okay
well, i have no idea
he doesn't explain anything
just spits out code