Full Screen Image Slider With HTML, CSS & JS

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2017
  • In this video we will be creating a full screen image slider with HTML, CSS and JavaScript. We will not be using any 3rd party libraries like jQuery. All Images are free stock images from pexels.com
    SPONSOR:
    Check out Coding Dojo - www.codingdojo.com/l/yt/tr
    CODE:
    codepen.io/bradtraversy/pen/b...
    BECOME A PATRON: Show support & get perks!
    / traversymedia
    ONE TIME DONATIONS:
    www.paypal.me/traversymedia
    VISIT MY WEBISTE: Check Out My Udemy Courses
    www.traversymedia.com
    FOLLOW TRAVERSY MEDIA:
    / traversymedia
    / traversymedia
    / traversymedia
    / discord
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 331

  • @SpenSahDude
    @SpenSahDude 6 ปีที่แล้ว +146

    Brad, your channel and videos are AWESOME. One thing that I would like to say, because you seem to be very concerned with it, is that (personally) I wouldn't care about your children/wife making noise in the background even if I WAS able to hear it. I'm so grateful that you take the time to put all of this knowledge into videos and then make them free for people like myself. Getting upset about something as trivial as background noise doesn't even register. A million thanks for all of your hard work, dedication, and altruism.

  • @jontyler87
    @jontyler87 6 ปีที่แล้ว +2

    Yet another awesome quality piece of content. Thank you!! You're the man, Brad!
    For what it's worth, I was wearing great headphones during your vid and I never heard any of the noises from your wife/kid :D

  • @MrNik0l0z
    @MrNik0l0z ปีที่แล้ว +1

    I was getting confused how to make slider but this one made everything very clear. Thanks Brad, appreciate your work a lot!

  • @oldguy8177able
    @oldguy8177able 4 ปีที่แล้ว

    dude awesome video very rare on youtube that someone is helpful,no false info,and clear and concise.

  • @blairowens22
    @blairowens22 5 ปีที่แล้ว +2

    Thanks a lot for this! I am putting together my first photography website for my friend and was struggling on creating a gallery. Your tutorial was easy to follow and straight-forward, leaving room for me to add me own styles :)

  • @evilgenius04
    @evilgenius04 6 ปีที่แล้ว

    Great tutorial. Quick and on point with the vanilla JS. No need to apologize for the noise it wasn't even noticeable. Thanks again!

  • @leeinly
    @leeinly 5 ปีที่แล้ว

    Thank you so much. I just started to learn about front-end development. And i was almost crying while copying a site for the portfolio. You helped me out! You are my hero!! Thank you again!!

  • @TheElkster
    @TheElkster 6 ปีที่แล้ว

    Really great video! I usually shy away from anything containing javascript but you explained it so very well it has rekindled my interest in taking another look at it! Thanks for taking the time to post!

  • @unison247
    @unison247 6 ปีที่แล้ว +4

    Hope you had a brilliant time with your Family for the rest of Sunday, great videos btw!

  • @Liam-fb4tu
    @Liam-fb4tu 6 ปีที่แล้ว

    You have a new subscriber! great easy to understand video. Just learning javascript so the fact the slider was built using just this rather than jQuery is quality. Thanks a ton mate!

  • @JennaJams
    @JennaJams 6 ปีที่แล้ว

    Another amazing tutorial. I'm loving your vanilla JS tutorials!

  • @manvshard8194
    @manvshard8194 5 ปีที่แล้ว

    A big "THX" from France. I searched about a simple tuto like this.
    You really are a great teacher :).

  • @1savedalex
    @1savedalex 4 ปีที่แล้ว

    Thank you so much for taking the time to make this video, this was exactly what I was looking for, and your tutorial was really easy to follow.

  • @thedevcristian
    @thedevcristian 6 ปีที่แล้ว +61

    Youre such a great developer. Thank you.

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว +7

      Thanks friend, I appreciate that :)

  •  3 ปีที่แล้ว

    The video is from exactly 3 years ago (I don't believe in coincidences :)) but it has helped me exactly now. I could implement a slider using this tutorial as an example.
    Thanks Brad, your videos always help me a lot.
    I have no words to express my gratitude!!!!

  • @MdShamimRahman
    @MdShamimRahman 6 ปีที่แล้ว

    The more I see his work more I like it. Thank you.

  • @lingeshvirinmoonsamy8692
    @lingeshvirinmoonsamy8692 6 ปีที่แล้ว

    Thank you Brad, you've helped me progress video by video... i just get better. You such a great role model. Wish we had more people in the world like you. Once again thanks

  • @davescorneroftheworld1147
    @davescorneroftheworld1147 4 ปีที่แล้ว

    Brad, I have watched so many of your tutorials in the last few months. I have learned so very VERY much thank you so much and I would not worry about background noise, we could not here it, and by the way we all have background noise in our lives you should not let that worry you, I know it does not bother us.

  • @aramayisorkusyan2451
    @aramayisorkusyan2451 6 ปีที่แล้ว +5

    Hey Brad, love all your videos! Just wanted to make a quick suggestion on vertically centering the arrows. Instead of eyeballing how much to move the div back up with a negative margin, you can use
    {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    }
    So you're moving the div down 50% of the page, then moving it up by 50% of the arrow divs hight.

  • @sonoftroy8572
    @sonoftroy8572 6 ปีที่แล้ว

    Thanks brad, I’m glad you help us beginners learn how to code better

  • @jz5748
    @jz5748 6 ปีที่แล้ว +3

    do u need the server to be downloaded...i have the images in style.css n not in html...n my browser wont display the images?anyone can help me?

  • @ksato3991
    @ksato3991 6 ปีที่แล้ว

    Thank you. All your videos I’ve watched so far are very helpful.

  • @demian5511
    @demian5511 6 ปีที่แล้ว +5

    Something a little bit different but works the same:
    arrowRight.onclick=nextSlide;
    function nextSlide(){
    reset();
    if(current===images.length-1){
    current=0;
    images[current].style.display="block";
    }else{
    current++;
    images[current].style.display="block";
    }
    };
    // displays previous image
    arrowLeft.onclick=prevSlide;
    function prevSlide(){
    reset();
    if(current===0){
    current=images.length-1;
    images[current].style.display="block";
    }else{
    current--;
    images[current].style.display="block";
    }
    };
    Great turorials! Keep up the good work!

  • @nickpaul5080
    @nickpaul5080 5 ปีที่แล้ว

    Brad, I am learning so much from your youtube tutorials. I'm 69 years old and looking to become a better web developer so I can retire from my FTJ and work from home. Your work is awesome, and I think it's great that your wife and kids are supporting you as you support us.

  • @heavydirtysoul1491
    @heavydirtysoul1491 4 ปีที่แล้ว

    as for me the best Vanilla JS slider tutorial so far

  • @steve_negrin
    @steve_negrin 6 ปีที่แล้ว

    Thanks Brad for your tutorials. i've learned a lot with you...keep doing great tutorials

  • @raistlinmajere2257
    @raistlinmajere2257 5 ปีที่แล้ว

    I'm implementing this in a mean stack app for a client. You're making me money. Thanks Brad!

  • @YTLeveeee
    @YTLeveeee 6 ปีที่แล้ว

    Man like Brad, what a legend for making this video!

  • @garrett3338
    @garrett3338 6 ปีที่แล้ว

    Such a great tutorial. Thanks Brad!

  • @jaepark75
    @jaepark75 6 ปีที่แล้ว

    I attended Coding Dojo and your name came up!! I'm admire your work. Thank you for the videos!

  • @busyrand
    @busyrand 6 ปีที่แล้ว

    I love this! Straight Html, CSS and Javascript development! Thank you for this! Your the Best.

  • @frankconte467
    @frankconte467 6 ปีที่แล้ว

    You are an excellent teacher. Can't wait to try it on my own.

  • @franciscoaltolaguirre1397
    @franciscoaltolaguirre1397 6 ปีที่แล้ว

    Thank you so much!! this is the class of tutorial i am searching for!

  • @user-gw4rp6cp9s
    @user-gw4rp6cp9s 6 หลายเดือนก่อน

    Awesome project , BRAD. I actually used more images for mine and it worked great. LOVE YOUR WORK

  • @olatera
    @olatera 6 ปีที่แล้ว

    Thank you, dude!! Everything works just perfect!!! Thousands of respects from js-noob like me! Im working at my first web-site and this video is the best tutorial Ive found!

  • @General_Aladeen
    @General_Aladeen 6 ปีที่แล้ว +70

    Thank you for not using jquery again. you're the man Brad.

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว +12

      I try not to use jQuery anymore aside from when I need something pre-made and quick.

    • @peterkabiru5144
      @peterkabiru5144 4 ปีที่แล้ว +1

      get us another movie!, what are you doing here Aladeen!

  • @adaniels4943
    @adaniels4943 6 ปีที่แล้ว +2

    What to do to keep the pics from distorting when the browser resizes from large screens to phone size? Any suggestions would be appreciated! Thanks for the tutorial!!

  • @hirephpdevelopers3840
    @hirephpdevelopers3840 6 ปีที่แล้ว

    You are my teacher, i have learned a lot from Traversy Media.

  • @elbasiriyouness1929
    @elbasiriyouness1929 5 ปีที่แล้ว

    Firstly, from now to ever I'll call you Teacher, you deserve it trillions times teacher. secondly to give and share knowledge with no reward thats absolutely a key of hapiness! may god protect, bless your steps you and you children and wife ameen! wish you happy too

  • @dilungmoveityafool777
    @dilungmoveityafool777 6 ปีที่แล้ว

    I have so much to learn, but thanks! Just the video I was looking for!

  • @Sususubieee
    @Sususubieee 6 ปีที่แล้ว

    This is absolutely amazing. Thank you.

  • @jegedeayodeji3306
    @jegedeayodeji3306 6 ปีที่แล้ว

    Hey Brad,
    Thanks for this awesome tutorial.

  • @aalindgupta585
    @aalindgupta585 6 ปีที่แล้ว

    Needed this one.. Thanks a lot man!

  • @raistlinmajere2257
    @raistlinmajere2257 6 ปีที่แล้ว

    Thanks Brad. Clean and simple.

  • @andrewm3406
    @andrewm3406 6 ปีที่แล้ว

    Thanks, Brad! Love your videos.

  • @Budding8660
    @Budding8660 4 ปีที่แล้ว

    always clear and easy to learn

  • @andzisimabaso5622
    @andzisimabaso5622 6 ปีที่แล้ว

    Thanks a lot bro. i have improved a lot in my coding thanks to you!

  • @irfanulhaqsoofi5275
    @irfanulhaqsoofi5275 2 ปีที่แล้ว

    Excellent tutorial for beginners. Thank you for your time and efforts.

  • @h3yfriday659
    @h3yfriday659 6 ปีที่แล้ว +1

    another simple but awesome tutorial! 😁

  • @melzlim
    @melzlim 6 ปีที่แล้ว

    Thank you so much for the effort! Really great tutorial

  • @GoodGuy374
    @GoodGuy374 6 ปีที่แล้ว

    awesome. best tutorial ever. i am learning so much from you. thank you.

  • @joseulissescastro4883
    @joseulissescastro4883 3 ปีที่แล้ว

    You just straight up saved my ass with this video man. Thanks for the great content and for free!

  • @DarkGT
    @DarkGT 6 ปีที่แล้ว

    That is a lot of coding for a simple web page, but result is awesome.

  • @vipsylar6370
    @vipsylar6370 6 ปีที่แล้ว +2

    Great tutorial bro, keep up the good work.

  • @rezarahman1782
    @rezarahman1782 3 ปีที่แล้ว

    I was trying for a couple of days to use iteration for slide. But something was always missing. Thanks Brad. You are just amazing.

  • @nevyanamomchilova8153
    @nevyanamomchilova8153 3 ปีที่แล้ว

    Love that video! Thank you very much!!!

  • @Garagegarments
    @Garagegarments 6 ปีที่แล้ว

    Your videos are so helpful! Thanks!

  • @juliehensgen7699
    @juliehensgen7699 6 ปีที่แล้ว

    exactly what I was needed....thanks!

  • @Abduboy13th
    @Abduboy13th 4 ปีที่แล้ว +2

    How do you make it switch smoothly or with other animation?

  • @bolovy6093
    @bolovy6093 6 ปีที่แล้ว +62

    More vanilla js tutorials please :)

    • @rasmushansen2391
      @rasmushansen2391 6 ปีที่แล้ว +1

      If you search his playlists you'll find a lot of great vanilla :)

  • @potterfreak63
    @potterfreak63 ปีที่แล้ว +1

    Hey! How do you add a transition with the arrows? Like how do you get the image to slide in after 2 seconds or something like that?

  • @mbaapohelviszonepoh1284
    @mbaapohelviszonepoh1284 3 ปีที่แล้ว

    it really saved me some time thanks

  • @kendo4165
    @kendo4165 6 ปีที่แล้ว +1

    Thank you! I liked that you used vanilla javascript.

  • @jassochivisuals5113
    @jassochivisuals5113 6 ปีที่แล้ว

    Amazing video Brad!

  • @MalekCode
    @MalekCode 3 ปีที่แล้ว

    Thanks for sharing your expertise🙏

  • @zerotoheroinenglish7624
    @zerotoheroinenglish7624 6 ปีที่แล้ว

    thank you so much for your tutorial. I found your video so understandable and quite simple. :-)

  • @MrIslamsadek
    @MrIslamsadek 6 ปีที่แล้ว +2

    Thank you Traversy!

  • @deemi4u474
    @deemi4u474 6 ปีที่แล้ว

    Great job and super grip on web devlopment activities.

  • @powerfulphotography6622
    @powerfulphotography6622 5 ปีที่แล้ว

    Excellent instructions thanks, what code do I need if I want my images to auto fade in on a loop

  • @lukebennett8773
    @lukebennett8773 6 ปีที่แล้ว

    Hi Brad, thanks so much for the video. It has really helped me out in my project. How would I go about adding a transition speed to the slider to slow it down? Is that possible with this technique?

  • @lachezarkanchev6672
    @lachezarkanchev6672 5 ปีที่แล้ว

    thanks . It was such a wonderful tutorial and very useful

  • @GodsAutobiography
    @GodsAutobiography 5 ปีที่แล้ว +3

    Many thanks for making this tutorial! Just so you know, I couldn't hear any noise that they were making. Your mic does well to not pick up those far-away sounds it seems haha.
    Happy to subscribe to this channel and I look forward to learning more from you!!

  • @paalaleksander
    @paalaleksander 2 ปีที่แล้ว

    Thanks so much for the tutorial, just what I needed for the exam... Just had to nest the javascript in a function so I could pass in data from the wordpress API that I'm using to add new post.

  • @IAmTheRealKen
    @IAmTheRealKen 6 ปีที่แล้ว

    Great tutorial, very useful. Thanks.

  • @filament02
    @filament02 5 ปีที่แล้ว

    hello brad thanks for the tutorial i use sass for a project i try to do the slide show but its seem not working when i put the link in the background-image do you know how can i fix the problem ?

  • @user-qq3jg5st2l
    @user-qq3jg5st2l 6 ปีที่แล้ว

    I'm your fan from Russia! Very useful tutorials! I always put you like that)

  • @adamrollerblader
    @adamrollerblader 6 ปีที่แล้ว

    Thx for your effort and great tutorial :)

  • @user-rp6xi4il5z
    @user-rp6xi4il5z 5 ปีที่แล้ว

    to be honest,i feel happy and sad at the time;you are the best tutorial teacher on TH-cam i have ever seen,the content of your video and your explanation are so great!i feel bad because i know you cant record these videos frequently,core knowledge is not free. but you are the best teacher,best wishes

  • @ibrahimN17
    @ibrahimN17 5 ปีที่แล้ว

    Thanks, I did learn a lot there :)

  • @user-dm4yi9ch3n
    @user-dm4yi9ch3n 4 ปีที่แล้ว

    Amazing lesson,dude!

  • @Steve_360
    @Steve_360 6 ปีที่แล้ว

    brad when i add the last startSlide(); to my script, my application wont run but when i take it out it works but when it first loads you can scroll through the images, but after you click one of the arrows you can't scroll anymore and then everything works as intended. i am kind of confused as to why that happens

  • @rinatvaliullov3247
    @rinatvaliullov3247 6 ปีที่แล้ว

    Interesting and usefull tutor as always, sir!

  • @SabbirAhmed-vs6ph
    @SabbirAhmed-vs6ph 5 ปีที่แล้ว

    Arrow css was awesome. You have got one more subscriber as a gift.

  • @sureshkumar-bj2ns
    @sureshkumar-bj2ns 6 ปีที่แล้ว

    Nice tutorial to learn...Works fine for me... Looking for more videos...

  • @87mustafaerden
    @87mustafaerden 6 ปีที่แล้ว

    If Brad teach space science, u can even learn it easily. Number 1 teacher.

  • @khamdamov
    @khamdamov 6 ปีที่แล้ว

    thank you man, you are a life saver

  • @yanivsalman9685
    @yanivsalman9685 6 ปีที่แล้ว +1

    Thank you! i wonder if you can do a really short video about "slick.js" vs "owel carusel 2". all the videos on youtube are in arabic or some other languages . i have some problems with slick.js.

  • @adamtoth2089
    @adamtoth2089 3 ปีที่แล้ว

    When listening to click in arrowRight, we set current to -1 because the slideRight function consequently increments to 0?

  • @vimal8966
    @vimal8966 6 ปีที่แล้ว

    Nice tutorial, thanks mate :)

  • @nagahumanbeingzooofparticl8836
    @nagahumanbeingzooofparticl8836 6 ปีที่แล้ว

    Thank you so much for the tutorial Brad..
    one question- My image does not load directly from index.html file but when i loads it from the live server it works perfectly.. don't know how to resolve this problem. Can anyone help me?

  • @waltergrigoryan6898
    @waltergrigoryan6898 6 ปีที่แล้ว

    i have a question, after i type cursor: pointer the background image disappears, any idea why?

  • @shellcasing1040
    @shellcasing1040 6 ปีที่แล้ว

    How do I make it show the images automatically, say every 2 seconds, without having to click the arrows, but still retaining the arrow functionality? I'm thinking of using setInterval but not really sure how...

  • @ultronsam1214
    @ultronsam1214 ปีที่แล้ว

    Hi! Excuse I do not understand the arrowRight, where you added + and (-) in the current. Can you explain those two parts.

  • @enkhbaatarbattulga9915
    @enkhbaatarbattulga9915 6 ปีที่แล้ว

    Thank you very much. Great video!

  • @shannonbenzing9361
    @shannonbenzing9361 2 ปีที่แล้ว

    Is there a video of doing this with the clickable arrows but that the images also transition on their own (slideshow type)?
    I need both in one.

  • @Shirwatel
    @Shirwatel 6 ปีที่แล้ว

    I'd love to see a MATLAB crash course if possible !!
    i love you & your channel, thanks for everything !!!

  • @kevinrose1927
    @kevinrose1927 6 ปีที่แล้ว +1

    I like the clean shave brad!

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว

      Thanks...Yeah the grey was getting out of hand lol.

  • @erykkryszewski5803
    @erykkryszewski5803 5 ปีที่แล้ว

    any idea how to make it change a bit more smoothly? not to just display none - display block but to add any transition. i've tried in css and nothing

  • @Skurvagis
    @Skurvagis 6 ปีที่แล้ว

    amazing! really helpful!

  • @samadhansalgar9181
    @samadhansalgar9181 6 ปีที่แล้ว

    Thanks lot Sir .....Supe Awesomer Tutorial