Create A Draggable Card Slider in HTML CSS & JavaScript | Infinite Image Slider in JavaScript

Поделиться
HTML-код
  • Опубликовано: 16 май 2024
  • In this video, I've shown how to create a draggable card slider in HTML, CSS, and JavaScript. In this card slider, the user can slide cards by dragging them or using the left or right buttons. It also includes an infinite scrolling and autoplay functionality.
    You won't need to rely on external plugins or libraries; we'll be using pure JavaScript to build this image slider from scratch.
    Download Images Only of this Image Slider
    drive.google.com/file/d/1pquP...
    Download Codes of this Image Slider
    www.codingnepalweb.com/dragga...
    Hire me on Fiverr
    www.fiverr.com/prakashahi
    Follow me on Instagram
    / coding.np
    Visit my website for helpful coding projects with source code
    www.codingnepalweb.com
    Timestamps:
    0:00 Demo of Image Slider
    1:50 HTML & CSS Start
    9:46 Making Carousel Responsive
    10:43 JavaScript Start
    11:09 Sliding Images on Mouse move
    16:02 Working on Previous & Next Button
    20:14 Creating Infinite Scrolling Effect
    26:34 Making Carousel Auto-play
    #javascript #html #css #javascriptprojects #js
    Music Credit:
    Ikson - We Are Free [Official]
    • #83 We Are Free (Offic...
    Those Restless Nights - Artificial.Music
    • Those Restless Nights ...
    Miss You - LiQWYD
    • Miss You - LiQWYD (No ...
    Ikson - Lights [Official]
    • #32 Lights (Official)

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

  • @seeker3794
    @seeker3794 11 месяцев назад +10

    Don't know others, but I have learned a lot from this video... Thank you very much for subtitles that explains the process and keeps focused.👍

  • @imParvez7
    @imParvez7 5 месяцев назад

    This is the video I've been looking over these years. Thank you so much.

  • @ebmpinyuri
    @ebmpinyuri 11 месяцев назад +1

    thank you so much for this , really improved my knowledge of stuff

  • @storysthattoucheslol
    @storysthattoucheslol 10 месяцев назад +2

    Thank you very much, this was really helpful and educative 👍

  • @EGY-Programmer
    @EGY-Programmer Месяц назад

    The best slider tutorial in the world out there!
    Really appreciate your videos bro ♥

  • @hussein7990
    @hussein7990 9 месяцев назад +1

    Love ur channel , keep it up

  • @kertosyt
    @kertosyt 9 месяцев назад +1

    this is very helpful ! thanx

  • @cydexcode
    @cydexcode Год назад +20

    Me : Watches a video of someone else programming instead of working on my own project that I keep putting off

  • @TLTechbender
    @TLTechbender 10 месяцев назад +1

    Thanks, This was so much helpful.

  • @NahuelBorromeo
    @NahuelBorromeo 2 месяца назад

    Amazing bro, thanks for the tutorial!

  • @VermaCoder
    @VermaCoder 7 месяцев назад

    Thanks for this... without speak your code speaks a lot.🙂👍 keep it up.. like this great work

  • @JulioCesar-hh9wq
    @JulioCesar-hh9wq 9 месяцев назад +1

    Dude, thanks a lot 10/10

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

    Bro great work it fits my project perfectly. However, what should i change exactly in the js code so that i can slide multiple menu not just one

  • @user-ot7fm4du2m
    @user-ot7fm4du2m 6 месяцев назад

    Супер! Спасибо тебе огромное! 👍👍👍

  • @aryatands2728
    @aryatands2728 Год назад +1

    Good Job bro...amazing

  • @loribryant4999
    @loribryant4999 9 месяцев назад +1

    is it possible for you to provide a live link for this, please?

  • @selonraymond6651
    @selonraymond6651 8 месяцев назад

    Brillant !

  • @coder_neha
    @coder_neha 8 месяцев назад +1

    Can i add only single div instead of three?

  • @sibadatta1990
    @sibadatta1990 Год назад +1

    Wow, u made it so simple. Thanks a lot

  • @beautyflower3107
    @beautyflower3107 10 месяцев назад +1

    Thank you very much for video

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

    Obrigado, ajudou no meu projeto.

  • @mariajegan2409
    @mariajegan2409 Год назад +1

    Bro this is AWESOME 😎👍

  • @herewegoeth
    @herewegoeth Год назад +1

    bro i love your projects please can make more videos on php

  • @llibanogs
    @llibanogs 5 месяцев назад

    really helpful thx

  • @WolfGSk
    @WolfGSk 7 месяцев назад

    hello. Awesome work there I tried to download the files from your site, a) I have removed adblock, b) I have tried to use private mode, c) I have use four different browsers and the message about the adBlock keeps popping up.

  • @user-ur1yg8gf4o
    @user-ur1yg8gf4o Год назад +1

    Hi, great job. Is it possible to rewrite this code on react? After I tried to rewrite the infinite loop process is not working smooth. Every turn at the last child I had a stuck until I try to swipe 2 more times. What can cause that problem? Any idea?

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

    Very good!!!! Very big thanks!!!)))🥰🥰🥰🥰

  • @anmolrk5076
    @anmolrk5076 Год назад +1

    Help me. It is working absolutely fine on left arrow but not returning back on clicking right arrow.
    Can you tell what may be the error?

  • @rajinsakha07
    @rajinsakha07 10 месяцев назад

    Thank you

  • @malikmuzammil9704
    @malikmuzammil9704 5 месяцев назад

    thanks u much for giving code

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

    Wow awesome

  • @mobileking3911
    @mobileking3911 11 месяцев назад +2

    The infite loop of the left button is not working. Any Idea why? Pls someone should answer.
    An Awesome video regardless. Kudos bro.
    Pls someone should provide an answer.

  • @harrymuliawan454
    @harrymuliawan454 11 месяцев назад +1

    is this possible if made with tailwind or bootstrap?

  • @feldspar081150
    @feldspar081150 7 месяцев назад

    I just made an account just to subscribe to this genius. thanks @codingNepal!

  • @umarcse8985
    @umarcse8985 Год назад +3

    Hello. I have a request for you. Your work is awesome. Would you please make a video about tab in javascript. Like project tab, skill tab, education tab etc in portfolio website?

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

      Are you talking about this tab? Video: ruclips.net/video/QtwXQdlvyWA/видео.html

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

      @@CodingNepal yeah. Got it. Thanks

  • @musahkamara
    @musahkamara 11 месяцев назад +3

    great Bro. It is perfect, but the left button is not working infinitively in my project despite I coded the same way as yours. thanks for the knowledge I have learned something new.

    • @mobileking3911
      @mobileking3911 11 месяцев назад +2

      Exactly... The infite loop of the left button is not working. Any Idea why? Pls someone should answer

    • @Justhue
      @Justhue 7 месяцев назад

      I encountered the same problem@@mobileking3911

  • @Clash-Roblox
    @Clash-Roblox 10 месяцев назад +1

    I have learned a lot from this video but I still wonder, can you scroll 3 images at a time you clicked one

  • @CecilitaB
    @CecilitaB 7 месяцев назад

    i love you

  • @alexandraweather4156
    @alexandraweather4156 22 дня назад

    thank you for this amasing video! i am a total newbie with js, but it worked for me. But now i need to make the slider undraggable, so that only buttons would cause it move. I have commented everything connected to dragging, an yet it remains draggable! how can i fix it?

  • @getachewchala3942
    @getachewchala3942 3 месяца назад

    Hi CodingNepal
    Please, can you make video on custom context menu on specific element like or or any like this?
    Thank you

  • @roemerlin9887
    @roemerlin9887 Год назад +10

    Hey, nice tutorial. Just one probleme: If you are dragging and let go it just snaps right in to place with no transition. Anybody know how to fix that?

    • @amabsteve2594
      @amabsteve2594 8 месяцев назад

      i have the same problem, did you found the solution yet?

    • @hooho491
      @hooho491 5 месяцев назад

      @@amabsteve2594 same. any solution?

    • @eduardo6727
      @eduardo6727 Месяц назад

      Hi, did you solve it? I have the same problem

  • @user-tg2fh5er9i
    @user-tg2fh5er9i 6 месяцев назад

    Thanx Bro.

  • @sume1907
    @sume1907 10 дней назад

    At 2:50, how did you change the last img's number while also changing the rest?

  • @Peace-hr6eo
    @Peace-hr6eo 11 месяцев назад +1

    Salam sir
    I want to move autoplay from left to right ? How can

  • @maxgamer6476
    @maxgamer6476 Год назад +1

    Aaaaaaaah men damn damn keep going

  • @elsami6052
    @elsami6052 Год назад +3

    hi, i love your video and your code. i want to do the same thing but whith 4 columuns in the front page. in css i change the "grid-auto-column : calc " to 4 but in the JS dosnt work because is codificate for 3 colums. what can i change to work whith 4 colums

    • @vintage_lol
      @vintage_lol 4 месяца назад

      i made it work with 5 columns.. it's quite simple, actually

  • @pablonavarro6263
    @pablonavarro6263 8 месяцев назад

    does anyone else have the problem that when you add "overflow: hidden" it hides the bottom cuts off the images like half way

    • @kiku_to_herself
      @kiku_to_herself 7 месяцев назад

      U might have given height to it , please check that

  • @smritikumari897
    @smritikumari897 Год назад +1

    Can you make a website with audio recorder and a writing pad with a video inbuilt guiding how to record and write.fully responsive.

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

    I like Ur CN logo
    Can u give a hint on how to make something like that
    🙏🙏🙏🙏🙏🙏🙏

  • @user-if6xv1cx1d
    @user-if6xv1cx1d 16 дней назад

    great

  • @blankspace4416
    @blankspace4416 7 месяцев назад

    Can i use this in my website with some changes in it !?

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

    First ❤

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

      Great! Hope you enjoyed the video.

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

    thank you very muc

  • @oscar_cornejo
    @oscar_cornejo 7 месяцев назад +1

    Can you make this slider with navigation dots please? 🤔

  • @truthhammer69
    @truthhammer69 Год назад +1

    Great tutorial, but the problem is, It cant transition when clicking on the right arrow, the left one is no problem.However, I assume a need to set it up such that it reverses back after 6 clicks, but it only does so after 7 clicks. Not sure how to make it transition after 6 clicks on the right.

    • @truthhammer69
      @truthhammer69 Год назад +3

      I resolved the issue: it was due to not the same card size and therefore grid-auto-columns and gap calculation ratio.

  • @Daily_problemsr
    @Daily_problemsr Год назад +1

    Bro Next Challange/Task IMG Background Changer And Png Maker 🙏🙏🙏🙏

  • @user-tn3cq6pf7e
    @user-tn3cq6pf7e 10 месяцев назад

    how can i use this multiple times in one page?

  • @LunarRunner
    @LunarRunner 4 месяца назад

    The infinite scroll logic does not work properly if you resize the screen and trigger the media selectors to change the number of cards in view. You need to keep track of the original carousel children before you slice the array and register window resize events and recalculate the firstCardWidth, cardPerView and re-slice the array with the next end cards. Other that that...excellent work!

  • @euclidesperez9682
    @euclidesperez9682 5 месяцев назад

    I have a question, do you prepare this video in advance? Or do you know all that and you don't need to think so much about what you will do?

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

    Thank you please make it's pagination buttons

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

    TypeError: Failed to execute 'insertAdjacentElement' on 'Element': parameter 2 is not of type 'Element'
    Chrome throwing this error when using card.outerHTML
    And when i am just using card it's just placinglast 3 items at start creating copies..
    Can anyone help?

  • @doBe1029
    @doBe1029 Месяц назад

    "There are two problems:
    1. When changing the screen ratio, autoPlay() function doesn't work.
    2. After changing the screen ratio, the slider doesn't loop back to the beginning once it reaches the last card. So, the infinite slide isn't working."

  • @sanketsingh5555
    @sanketsingh5555 Год назад +1

    bro please same video with explanation why u used this that etc etc...

  • @TutoMaster
    @TutoMaster 14 дней назад

    How do you learn do that by yourself? How can i get this level in Javascript?

  • @smpnegeri3bangkalan681
    @smpnegeri3bangkalan681 11 месяцев назад

    Hi bro, is itworking for blogspot?

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

    great great

  • @husnamert477
    @husnamert477 5 месяцев назад

    all this examples is so good but We using nextjs to our prooject and when we trying implement some code from like that examples then it is throw always error.. lol

  • @buzzkagirl
    @buzzkagirl Год назад +1

    Hi can you show how to create train running status using rapid API key

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

      Okay, I'll think on it.

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

      @@CodingNepal thanks,I must say you are making us how to do coding with your videos and website, your website is very informative...

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

    Can't reach code?!

  • @sume1907
    @sume1907 10 дней назад

    At 13:58, how did you select multiple lines like that?

  • @pandipatipavan3804
    @pandipatipavan3804 Год назад +1

    Please provide the code files and the links in the description as soon as possible for free 🙏 thank you

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

      Sure, the source code will be free, and a link will be provided soon in the description.

    • @pandipatipavan3804
      @pandipatipavan3804 Год назад +1

      @@CodingNepal Yeah sure. Please do it for all the videos if it is possible. Thank You so much brother 🙏

  • @sucess369
    @sucess369 Год назад +1

    Dai euta Q&A video chaiyo k hamlai

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

      Hunxa brother, I'll think on it.

  • @rtxgamelab.official
    @rtxgamelab.official Год назад +2

    I thought you were one of these someone
    😕😕

  • @emaesee4284
    @emaesee4284 3 месяца назад

    scroll-behavior: smooth; don't work

  • @onceonce_studio
    @onceonce_studio 7 месяцев назад

    la madre para los mudos con voz

  • @CoderLoAnt
    @CoderLoAnt Месяц назад

    please, free code

  • @mysearchhero
    @mysearchhero Год назад +1

    Asowme

  • @WhiteHeterosexualMenHere
    @WhiteHeterosexualMenHere Месяц назад

    Спасибо Молодец