Build a Touch Slider with HTML, CSS & JavaScript

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • Build a full screen touch slider with HTML, CSS & JavaScript
    Full Screen Touch Slider Repo:
    github.com/bushblade/Full-Scr...
    React Component Repo:
    github.com/bushblade/react-to...
    RUclips Video Codepen:
    codepen.io/bradtraversy/pen/E...
    Handmade Knives By Will Adams:
    bushblade.co.uk/
    Timestamps:
    0:00 - Intro
    1:49 - The HTML
    3:32 - The CSS
    10:57 - The JavaScript
  • НаукаНаука

Комментарии • 212

  • @quickcodingtuts
    @quickcodingtuts 3 года назад +71

    I always find myself dropping whatever I'm currently doing and watching these videos.

    • @TraversyMedia
      @TraversyMedia  3 года назад +12

      Well, thank you :) I appreciate that

    • @lifeform106
      @lifeform106 3 года назад

      @@TraversyMedia Yes these videos are very useful and well explained

    • @helpgl557
      @helpgl557 3 года назад

      @@lifeform106 on second line you can close video, cause he look for every f slides, instead of find all slides in container above. or use array.from instead of [...]

    • @borisvolkov1113
      @borisvolkov1113 3 года назад

      @@helpgl557 he use old aproach, what's wrong with that

  • @adyarabiat9394
    @adyarabiat9394 3 года назад +16

    Brad You are the best as usual, Thank you for all your effort and this amazing work on this channel

  • @r-i-ch
    @r-i-ch 3 года назад +13

    I would definitely point out that if you do a full-screen slide like this, you MUST put some indicator on each side of the picture (probably "" sort of things), otherwise it is not at all obvious to your user that they can swipe horizontally. Thanks for the great Tut as always!

  • @ericzorn3735
    @ericzorn3735 3 года назад +3

    As someone who works professionally in react every day as well as always chasing frameworks, it’s a pleasure to see vanilla JavaScript on the front end. thank you Brad!

  • @godfreyndiritu369
    @godfreyndiritu369 3 года назад +7

    Brad is the best instructor ever. I love his dedication and his unique way of explaining had concepts. Thank you so much Brad, you are the best, God bless you exceedingly and abundantly.

  • @garetts8156
    @garetts8156 3 года назад +6

    I'm at the end of the third of your courses on Udemy and I can tell - you are great at explaining things even if you have to repeat yourself over and over again. Thank you for great content!

  • @mx9577
    @mx9577 3 года назад +2

    Because of your courses i’m very confident to use HTML/CSS/Sass and now i’m half-way thru JavaScript. Thank you Brad.

  • @neillunavat
    @neillunavat 3 года назад +26

    *Legends are always 1 minute after uploading.* 👊

  • @jaimemontesdeoca7989
    @jaimemontesdeoca7989 Год назад +2

    Watching it at the end of 2022 and I find it amazing! I learned a lot today. Thank you Brad for the excellent job you always do. We really appreciate it. 👍💯

  • @informationgiant7697
    @informationgiant7697 3 года назад +6

    You are just awesome Brad, you always bring us something amazing and new particularly JavaScript , I love Vanilla by the way ;)

  • @danielcir8675
    @danielcir8675 3 года назад

    Amazing Brad!!! Thanks for all the great little and big projects you share with us!!!

  • @frankiefab
    @frankiefab 3 года назад +1

    This year is already blessed. Thanks Brad

  • @chandansayed8745
    @chandansayed8745 3 года назад

    It's always great to hear from you, Sir!

  • @Bathog44
    @Bathog44 3 года назад

    I'm not a web developer, but I've been asked to do a website for the club. I was able to follow your brilliant video and got it working. It works really well for my application. You explained each step so well and I learnt a lot. thanks so much.

  • @ibrahimkconteh
    @ibrahimkconteh 3 года назад +4

    thank you Brad you're changing the lives of many in the world

  • @abubakaryasin8610
    @abubakaryasin8610 3 года назад +2

    You are feeding and helping alot of people in this pandemic to chage their job.
    We appreciate 🙏 you

  • @anushka_24.05
    @anushka_24.05 3 года назад +1

    Love yours and Florin pop's 50 projects in 50 days course. It has top notch content.
    Good work.

  • @victory_lucky
    @victory_lucky 3 года назад +1

    often times,l i wonder if you're an angel,
    i was recently planning on creating a slider library, but i had some challenges, then boom your video popped out,
    thanks brad.

  • @in43sh
    @in43sh 3 года назад +1

    I will need this in my next project. Thank you, Brad!

  • @amrnashaat7063
    @amrnashaat7063 3 года назад +2

    i like this type of vidoes that makes cool stuff using the basics only, really helpful

  • @TruzzBlogg
    @TruzzBlogg 3 года назад

    Superb content, as usual! Brad is a *legend* and a *huge inspiration!* Greetings from Spain!

  • @aldobangun223
    @aldobangun223 3 года назад +1

    Thanks Brad. Learn a lot from this channel 🦾

  • @LemaTechMedia
    @LemaTechMedia 3 года назад +1

    I've been looking for something like this. Awesome!

  • @adnanghannam5279
    @adnanghannam5279 3 года назад

    one of the best channels for web developing, thanks a lot for the awesome content

  • @ahmad-murery
    @ahmad-murery 3 года назад +2

    Thanks Brad,
    Nice use of closure in the touchStart handler,
    as an alternative one can store the index in slide.dataset.index for example and then in the touchStart we can retrieve it back and update the currentIndex,
    another way to get the index from within the touchStart can be done using slides.indexOf(event.target)
    Not tested but I think it'll work.
    Thanks once again

  • @not_enoughmana
    @not_enoughmana 3 года назад

    An alternative to using Array.from (if you wanna save space) could be spreading the NodeList too. Awesome tutorial, Brad! 🎉So glad you're back doing these! 😊

  • @Richter12
    @Richter12 3 года назад

    Thank you so much, I was looking exactly for this. I needed to make a carousel from scratch supporting touch only for mobile and this did the trick. You're the best!

  • @Swesh
    @Swesh 3 года назад

    This is awesome, one tutorial and many useful features! That's is why I 💖 Brad 👌👌

  • @andrenations1
    @andrenations1 3 года назад

    damn i just finished this project. it took me 10 hour because i was studying and doing the project at the same time. this guy is such a good teacher i cant believe i find out about this channel. thanks very much for this lesson.

  • @tatsoskabos5348
    @tatsoskabos5348 2 года назад

    I finally learned how to make an image slider, thank you Brad

  • @brnheavymetal
    @brnheavymetal 3 года назад +2

    I always love to study with these pure HTML/CSS/Vanilla JS tutorials, last year I completed your 20 Vanilla JS Projects on Udemy and now I'm studying the 50 Projects in 50 Days

    • @michaelchung8102
      @michaelchung8102 3 года назад +1

      Could you share a link to the Udemy courses please? 😃

  • @EmilYOo0
    @EmilYOo0 3 года назад

    BARD!!! just what i needed for my final project on my sutdies. been folowing from 2018, took several of your courses on Udemy..
    Thank you!

  • @skillzorskillsson8228
    @skillzorskillsson8228 3 года назад

    I was looking for this a few years ago... I was searching like crazy and i could not find it. Thank you very much for share !

  • @AbuMaxeem
    @AbuMaxeem 3 года назад +1

    Thank you ... your efforts are highly appreciated

  • @igorsmet1123
    @igorsmet1123 2 года назад

    it took me about 3+ hours to understand how it works, I am quite new to javascript
    thank you

  • @smoshtitty
    @smoshtitty 2 года назад

    Thanks man! Really efficient and easy to follow tutorial :)

  • @mahdisoultana4926
    @mahdisoultana4926 3 года назад +1

    wooooooow it's really cool i want always to do that but finally you made it and i will learn how to expand this thank you very much Brad

  • @Generally2310
    @Generally2310 2 года назад

    Very good. I played with carousels lately and I had fun trying to develop my own version and frankly it feels good to make something cool alone

  • @NERO-ez1mn
    @NERO-ez1mn 3 года назад +1

    hope it was looping. still good as usual. just like brad says everytime. "you will get to understand js gradually when doing it everyday"

  • @Martin-xx2kw
    @Martin-xx2kw 3 года назад +1

    Love your tutorials!!!

  • @prasannanaik1023
    @prasannanaik1023 3 года назад

    Great one!!!
    Keep uploading more these kinda js stuff projects 😊

  • @alexkey9372
    @alexkey9372 3 года назад

    You are reading our minds! Excellent tutorial and I will use this for my client's project if you don't mind :) it's the best scroll effect when having lots of content stack below each other on mobile view. this will make the site feel more of an app :)

  • @md.siddiq7165
    @md.siddiq7165 3 года назад +1

    Awesom video Sir. Love your videos.

  • @didierabder8455
    @didierabder8455 3 года назад

    Just in time, I needed a lightweight carousel ! Will move the code into a WebComponent. Thanks

  • @cesaratachao5551
    @cesaratachao5551 3 года назад +1

    Thank you! It was very helpful

  • @crazystuff6760
    @crazystuff6760 3 года назад

    Amazing Brad!

  • @michaelastl
    @michaelastl 3 года назад

    Thank you, that helps me a lot and also inspires me how to create thing!

  • @TimVandeSluisArtist
    @TimVandeSluisArtist Год назад

    Great project. Thank you.

  • @DennisIvy
    @DennisIvy 3 года назад +62

    Looks really cool!

  • @ES-jq6zo
    @ES-jq6zo 3 года назад +1

    Thank you for all !!!

  • @raufalhassan253
    @raufalhassan253 3 года назад

    I have been looking for a course like because when I use swiper.js and bundle I with webpack the swiper.js file is larger than my whole code. now I can create my own sliders. I am with the course. Thanks brad for the basics now I can advance it and make work how I want it like adding auto slides.

  • @tobuwaboh_u8223
    @tobuwaboh_u8223 3 года назад

    thank you so much, looks really convenient and modern, i am learning js, hope one day i ll able to write codes like this by myself :)

  • @ivokrushkov2674
    @ivokrushkov2674 3 года назад

    another great tutorial. Thank you

  • @josip1306
    @josip1306 2 года назад

    This was great, thanks!

  • @arnoldphora1820
    @arnoldphora1820 2 года назад

    In like Brads videos, they are very good.

  • @dailymeow3283
    @dailymeow3283 3 года назад

    Awesome kinda carousel, i like it,
    A live chat assistant app would be a good idea too

  • @kk2070464
    @kk2070464 3 года назад

    Wonderful Brad

  • @tionbai6087
    @tionbai6087 3 года назад +1

    Hi, Brad! Thank you so much for your tutorials, you truly have a gift of teaching. You teach in such a straightforward manner and make advanced concepts understandable to everyone. God bless you, and I pray that Jesus Christ will lead you in hope and peace for the continuation of your journey. Much love from Norway

  • @mfaiz6
    @mfaiz6 3 года назад

    Thank you so much for this🔥

  • @LuisLeiva-li1hm
    @LuisLeiva-li1hm Год назад

    Awesome tutorials!!!

  • @johnmichaelnolasco5404
    @johnmichaelnolasco5404 3 года назад

    more of this please, i want to learn more html, css and javascript combined

  • @natimitiku5953
    @natimitiku5953 3 года назад +1

    You are always helpful🤗

  • @zeaglailson
    @zeaglailson 2 года назад

    the best ever from youtube

  • @user-yd7db3wd7w
    @user-yd7db3wd7w 3 года назад

    I've been developing an app and it has a feature to view content in different styles. My friend suggested me to implement the fullscreen touch-drag one but I didn't want to spend time on implementing this feature as I had other things to do. However, if smn has already implemented this with only one component...I'll take it into consideration :D thx for the video

  • @romuloalves9349
    @romuloalves9349 3 года назад +2

    Ótimo vídeo parabéns ✌.

  • @gambomaster
    @gambomaster 3 года назад +7

    Bought your's and Dennis Ivy's new course 'Django with React' yesterday. Would love to see you cover Django with React on this channel as well. Thanks. 👍

    • @TraversyMedia
      @TraversyMedia  3 года назад +5

      Dennis is planning a really cool Django project for the channel. I will be doing a few Django projects this year as well

  • @andreivaraujo8933
    @andreivaraujo8933 3 года назад +1

    Congratulations! Please legend!

  • @alfabetony
    @alfabetony 3 года назад

    great video the hard part is remembering what all this is after typing it all in !

  • @TheAlchemistsBrewery
    @TheAlchemistsBrewery 3 года назад

    Great content!

  • @user-ez2xz6fx7l
    @user-ez2xz6fx7l 3 года назад

    Nice video, thanks for making them.
    Actually, that would be nice if you made more of non-trivial demos on the channel, like, drag-n-drop, touch sliders, caching layers in real time apps, etc.

  • @martunjaykumar752
    @martunjaykumar752 2 года назад

    thanks for the nice tutorial

  • @Martin-xx2kw
    @Martin-xx2kw 3 года назад

    You [are] the best!

  • @adyarabiat9394
    @adyarabiat9394 3 года назад +1

    I hope you start live streaming, not just coding but also general talks about coding and some-other interesting stuff

  • @hasanboyabdurahmonov2520
    @hasanboyabdurahmonov2520 3 года назад

    God bless you Brad

  • @novailoveyou
    @novailoveyou 3 года назад

    Brad boss, as always

  • @pablojs_220
    @pablojs_220 3 года назад

    incredible!
    a query, what plugin did you use to display the cell phone when you activated it?
    Greetings from Costa Rica

  • @HoNow222
    @HoNow222 3 года назад

    You never loose your magic!

  • @omarcortes5754
    @omarcortes5754 3 года назад

    Very useful.

  • @theseriouslook
    @theseriouslook 3 года назад

    Just what I wanted

  • @plaguegames3556
    @plaguegames3556 3 года назад

    Iphone 12 is so damn cheap in the US!
    Great job and thank you for the tutorial Brad.

  • @josephadeusi5632
    @josephadeusi5632 3 года назад

    Your videos have helped me much on my CSS and html... Whaooo ..thanks to you... Please is there anyway I can learn java script on android ... I downloaded your JS crash course but I couldn't use it on my android device... Once again, thanks ... I love what you are doing..🙏

  • @hakeemh6675
    @hakeemh6675 6 месяцев назад

    Great tutorial! Just one question. Is there anyway to get the little dots under the image that indicate which slide your on?

  • @tomiwaale7540
    @tomiwaale7540 3 года назад +1

    Awesome video

    • @neillunavat
      @neillunavat 3 года назад

      Bro the vid just uploaded

  • @aadinoyis
    @aadinoyis 3 года назад +1

    I'd say you're using dejavu... You just uploaded the answer to my question!

  • @alperdogan7838
    @alperdogan7838 3 года назад

    Thanks for this great guide! Is there a guide to create this with React?

  • @gilbertojunior1712
    @gilbertojunior1712 3 года назад +1

    Thanks Brad
    Could you please activate the video subtitles?

  • @JenuelDev
    @JenuelDev 3 года назад

    looks awesome,, :)

  • @emanueltejadacoste2250
    @emanueltejadacoste2250 3 года назад

    Hey brad! I have an important question for you... I know a little bit of Html, css and js, I took the web developer bootcamp and also your Api masterclass with node but never touch react before, do you think I can learn react with your e-commerce course ?

  • @justcurious2439
    @justcurious2439 3 года назад +1

    Do you have an updated JavaScript course?

  • @user-fc6mr3wy5g
    @user-fc6mr3wy5g 3 года назад

    I learned a lot from this video, Thank you so much!! But I have a little question: why use clientX and pageX? What will happen if we use clientX in desktop?

  • @Dronius_D
    @Dronius_D 3 года назад

    Thank you very much for this tutorial! Could you please tell how to disable swiping on the first and last slides? So that I cannot swipe right after last slide and before first slide

  • @jonathanalixpierredort8932
    @jonathanalixpierredort8932 3 года назад

    Thx a lot!!

  • @nikhilmwarrier7948
    @nikhilmwarrier7948 3 года назад +1

    Awesome! What do you think of using css "scroll-snap" property? It is pretty useful as it kinda simulates slides by snapping scroll positions and doesn't require js.

    • @willadams6217
      @willadams6217 3 года назад +1

      I actually tried that before going with transforms and requestAnimationFrame it did kind of work, but not as well. IIRC you can't remove the overflow or the scroll bar as that stops it working. Worked better in mobile view than in desktop.

    • @nikhilmwarrier7948
      @nikhilmwarrier7948 3 года назад +1

      @@willadams6217 Yeah, but here is a quick webkit-only fix to lessen scrollbar annoyances:
      Use the ::-webkit-scrollbar selector and change the scrollbar size to some thing like 3px. It is pretty flexible. Though for Firefox its a bit harder. Just look for some MDN docs

    • @willadams6217
      @willadams6217 3 года назад +1

      @@nikhilmwarrier7948 Yeah I tried that but wasn't happy with it.

  • @hamahawlery7194
    @hamahawlery7194 3 года назад

    Thanks dude

  • @bolanhost
    @bolanhost 3 года назад

    Amazing

  • @useraat
    @useraat 3 года назад

    I love your tutorials Amazing work !Can I use the code for my self?

  • @greenshaheen6716
    @greenshaheen6716 3 года назад +1

    Cool..❤❤

  • @Ameersoccerdev
    @Ameersoccerdev 3 года назад +1

    Sir please tell me which project make for react js job I do your project of react.js

  • @asimimam2289
    @asimimam2289 3 года назад

    Thank You! Can you please add next and previous button on the same project

  • @saurabhsikoria6125
    @saurabhsikoria6125 3 года назад

    Learning a lot by such videos, pls make like these, helping me a lot buddy! ✌