Тёмный

Vanilla JavaScript: Infinite Scrolling Image Slider 

Conor Bailey
Подписаться 11 тыс.
Просмотров 34 тыс.
50% 1

Hi guys,
Back with another video using the infinite scrolling effect i covered a few weeks back. Here we will be applying the same concepts to an image slider.
I hope you enjoy.
Please subscribe.
Thanks
Conor

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 63   
@bryandelacruz9066
@bryandelacruz9066 3 года назад
Hi is it possible to add horizontal scroller that will control that carousel? thanks
@mattdon6705
@mattdon6705 2 года назад
Didn't work for me though I followed the tutorial throughout. Did the exact thing in this tutorial but not scrolling
@mutantmantish6141
@mutantmantish6141 Год назад
Hey👋, I absolutely love your content and I try them too.. but this code is not working for me. Can you please upload the source code so that I can fix the issue? Thank you.
@mariewright2820
@mariewright2820 2 года назад
Hey Conor 👋! Thanks a lot for this tutorial, really enjoyed your pace and the way you explained your reasoning 💯 I've tried to recreate your image slider to practise my JS but for some reason the infinite loop doesn't seem to be working for me. I can only scroll down from the first image which takes me to the last clone and then the slider background disappears and I'm left with a blank space next to the last clone .. I've looked and looked through my lines of code, carefully comparing it to yours but I just can't see what I'm missing! If you have any idea what might be causing this I'd be really thankful 🙏 Again thanks a lot for this tutorial!!
@omarbalanzar3093
@omarbalanzar3093 3 года назад
can u upload the ocde
@zubairameen
@zubairameen 2 года назад
Yes please provide this code if someone have written.
@CompilingInput
@CompilingInput 3 года назад
hello there, i have a question regarding scraping with chrome console from your previous videos, how do u go about extracting elements whose inner text changes on hover?
@vredchasing8926
@vredchasing8926 2 месяца назад
Why doesnt the effect work on mobile? Don't understand why it wouldnt work on mobile.
@ConorBailey
@ConorBailey 2 месяца назад
@@vredchasing8926 because the viewport on mobile devices changes on scroll in different directions so makes it appear app janky. I have figure this out though and made a mobile friendly version recently. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-p43Sv6O0IYQ.htmlsi=TIaVTbqEWeT2fFH4
@vredchasing8926
@vredchasing8926 2 месяца назад
@@ConorBailey I watched your one video on a horizontal scroller effect. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yXnK8ND76z8.html&ab_channel=ConorBailey My question is, is this approach considered wrong? These are different scenarios, but is this approach still good ? I'm learning to get a job, not sure if I learnt a "bad" way to do it.
@ebukavictory3178
@ebukavictory3178 Год назад
my images are not displaying in my console it is just listing them in an array but it wont display on my page .....anyone with solutions please??
@techtricks.tech_
@techtricks.tech_ 2 года назад
source code plz
@zbataille
@zbataille 2 года назад
Hey g'day there - have no idea what i am doing and just need to know how to add images to img div to display images within slider...
@lewisshields6393
@lewisshields6393 2 года назад
hi, thanks so much for this! wondering if it can still work using tags within the DIVs to get the images from a URL instead. Seems like it should be can't get it working!
@georgegamerfloyder1989
@georgegamerfloyder1989 2 года назад
I have an issue scrolling when I have H1 included on my page. When I scroll down H1 text just disapears.
@brianjett1446
@brianjett1446 Год назад
Why does it looks so blurry on my phone??
@adambakir3533
@adambakir3533 Год назад
great job , but how can I make it responsive for mobile
@spooder-mon7191
@spooder-mon7191 3 года назад
This is the first video I'm seeing from ur channel........time to subscribe ❤️
@jun1408
@jun1408 2 года назад
hi ist possible to have this effect combine with auto play
@sandrokann9054
@sandrokann9054 3 года назад
Sorry me, My '$' doesn't work when I try to load the images from the image folder. Thank you
@ConorBailey
@ConorBailey 3 года назад
are you using backticks? ``
@mohamedyoussef8835
@mohamedyoussef8835 Год назад
Awesome video ++++++++++++++++ 🙂
@minhmannguyen6492
@minhmannguyen6492 Год назад
how about ScrollX?
@eip408
@eip408 2 года назад
Hey Conor thanks for this amazing tutorial🙌🏼
@abdulrahmanalmuhajir894
@abdulrahmanalmuhajir894 2 года назад
Can you share the source code ...
@LouisHellinger
@LouisHellinger 2 года назад
This is great! Thanks!
@hastaman321
@hastaman321 2 года назад
How do I get this working with a specific class? There are multiple classes on the page, but the scroll affects all of them.
@hastaman321
@hastaman321 2 года назад
It's okay, I got it
@9e9r9i9k
@9e9r9i9k 2 года назад
@@hastaman321 How did you pull this off? I've been trying to get it worked out with no success. Thanks
@hastaman321
@hastaman321 2 года назад
@@9e9r9i9k Sorry, it's been while but I think I just just set their position as fixed in CSS.
@hastaman321
@hastaman321 2 года назад
Is there anyway to do this vertically?
@ConorBailey
@ConorBailey 2 года назад
Sure! Same concept applied vertically here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-6qf3_KAAVQA.html
@gulsummaslak9753
@gulsummaslak9753 3 года назад
I wrote the same, why can't it work? What is the difference between javascript and vanilla javascript?
@ConorBailey
@ConorBailey 3 года назад
Vanilla JavaScript is just normal JavaScript. What error are you receiving?
@gulsummaslak9753
@gulsummaslak9753 3 года назад
@@ConorBailey photos are not visible. console it says Failed to load resource: net::ERR_FILE_NOT_FOUND this is the error
@ConorBailey
@ConorBailey 3 года назад
@@gulsummaslak9753 ok can you paste your css / js to show how your referencing the image locations please.
@gulsummaslak9753
@gulsummaslak9753 3 года назад
@@ConorBailey *{margin:0; padding:0; box-sizing:border-box;} .slider-wrap{position:fixed; top:20%; left:10%; width:80%; height:300px; overflow:hidden; border:1px solid black;} .slider{position:absolute; top:0; left:0; height:100%; width:4000px; display:flex; will-change:transform; background-color:black;} .slider-item{po7:relative; flex:1%; top:2.5%; width:98%; height:95%; background-size:cover; background-position:center;} let sliderWrap = document.querySelector('.slider-wrap'); let slider = document.querySelector(".slider"); let clonesWidth; let sliderWidth; let clones = []; let disableScroll = false; let scrollPos; let items = [...document.querySelectorAll('.slider-item')]; let images = [...document.querySelectorAll('.img-div')]; images.forEach((image, idx) => { image.style.backgroundImage = `url(./images/${idx+1}.jpeg)` });
@ConorBailey
@ConorBailey 3 года назад
@@gulsummaslak9753 hmm that looks ok to me. Is your images folder in the same directory as your js file?
@codewithehr8376
@codewithehr8376 3 года назад
thats cool
@ConorBailey
@ConorBailey 3 года назад
Thanks Parme. Any projects on the go at the moment?
@shubhamsingh6639
@shubhamsingh6639 3 года назад
How can we add autoplay in this?
@ConorBailey
@ConorBailey 3 года назад
Hey I’ll create a code pen a post here shortly
@shubhamsingh6639
@shubhamsingh6639 3 года назад
@@ConorBailey Thank you very much.
@ConorBailey
@ConorBailey 3 года назад
@@shubhamsingh6639 codepen.io/conorbailey/pen/PobwYmw
@ConorBailey
@ConorBailey 3 года назад
something like this?
@shubhamsingh6639
@shubhamsingh6639 3 года назад
@@ConorBailey This is also good but I was talking of one item(image) sliding at a time like they do in owl carousel.
@spunkfuckshitpiss3667
@spunkfuckshitpiss3667 3 года назад
yo Conor! upload more videos you are great on drums really admire you!!!!!!!!!!!!!!!!!!!!!
@ConorBailey
@ConorBailey 3 года назад
Hey Sasza! Thanks so much for the comment. You a drummer too? Or programmer?
@spunkfuckshitpiss3667
@spunkfuckshitpiss3667 3 года назад
@@ConorBailey im drummer too!
@nickwoodward819
@nickwoodward819 Год назад
would be nice to know your approach before you start coding - 'we're going to clone the images' doesn't really explain how you're going to tackle the problem
Далее
How To Create An Image Slider In HTML, CSS & Javascript
24:42
Дикий Бармалей разозлил всех!
01:00
Subtle, yet Beautiful Scroll Animations
5:04
Просмотров 1,7 млн
Build a Touch Slider with HTML, CSS & JavaScript
34:49
Просмотров 137 тыс.
How to make a Vanilla JS Carousel
51:40
Просмотров 2,2 тыс.