+ 13
Help with HTML please 😄
It's been a while since I have asked a question like this on SL. I would like to know how to create a slider in web? Like a slideshow, or an image slider. Is there a way to do it with CSS? I'm not very good at JavaScript 😅 Any help is appreciated 😄 Thank you 😊
7 odpowiedzi
+ 14
Yes, you can do it with only CSS, although it is not very common.
The trick is to make an infinite animation and play with the margins. In Codepen there is a great example of what I say:
https://codepen.io/daysahead/pen/mJqBge
+ 8
@Mickel Thanks 😊
+ 8
Step 1: Array of images
Step 2: Buttons for next and previous
Step 3: next() and previous()
Here is my hall of fame code.
https://code.sololearn.com/WyUb3qV9HD3a/?ref=app
This uses an image slider so you might use it :)
+ 5
You can see this one. It uses only basic js.😊
https://code.sololearn.com/Wdhu3v833Iml/?ref=app
+ 4
@Mickel nice! But that's just an animation. Image slider means there must be two buttons so that user could change image as per wish and so it requires js.
+ 3
Yes, there's a way to make a slider with using just basic js and CSS, it doesn't require to be very good at js😉.