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

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 117

  • @true_bites
    @true_bites Рік тому +10

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

  • @EGY-Programmer
    @EGY-Programmer 8 місяців тому +2

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

  • @seeker3794
    @seeker3794 Рік тому +15

    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.👍

  • @cydexcode
    @cydexcode Рік тому +30

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

  • @marcoslavarellocambaceres7051
    @marcoslavarellocambaceres7051 10 днів тому

    Awesome work man! No words to say. Subscribed
    Thank you so much!

  • @sume1907
    @sume1907 7 місяців тому

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

  • @coder_neha
    @coder_neha Рік тому +1

    Can i add only single div instead of three?

  • @BabarQureshi-n2j
    @BabarQureshi-n2j Рік тому +1

    how can i use this multiple times in one page?

  • @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?

  • @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 11 місяців тому

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

  • @yume3119
    @yume3119 5 місяців тому

    Caso alguém com problemas no redimensionamento esteja com problemas, vai umas diquinhas aqui:
    - crie uma função para definir os valores de **card width** e **card_per_view*** e então chame essa função quando a página carregar e sempre que a tela for redimensionada.
    - crie uma função própria para criar os clones dos cards no início da lista; remova clones já existentes e crie novos. Chame essa função dentro da anterior para os clones serem criados com os valores atualizados.

  • @harrymuliawan454
    @harrymuliawan454 Рік тому +1

    is this possible if made with tailwind or bootstrap?

  • @feldspar081150
    @feldspar081150 Рік тому

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

  • @loribryant4999
    @loribryant4999 Рік тому +1

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

  • @03_Sanjay
    @03_Sanjay 3 місяці тому

    I want to copy the same slider while making a website but when I click left or right icons for the second one it moves the first image slider only ...how to fix it in js

  • @sume1907
    @sume1907 7 місяців тому

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

    • @minenmaster5179
      @minenmaster5179 7 місяців тому

      Holding ALT in VS-Code let's you do that

  • @oscar_cornejo
    @oscar_cornejo Рік тому +1

    Can you make this slider with navigation dots please? 🤔

  • @roemerlin9887
    @roemerlin9887 Рік тому +11

    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 Рік тому

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

    • @hooho491
      @hooho491 Рік тому +1

      @@amabsteve2594 same. any solution?

    • @eduardo6727
      @eduardo6727 9 місяців тому

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

  • @mohamadghalebizade9981
    @mohamadghalebizade9981 6 місяців тому

    Nice video, How do you remove the eventlisteners, cuz each time user clicks or does anything an eventlistener will start popping up and stack?

  • @beautyflower3107
    @beautyflower3107 Рік тому +1

    Thank you very much for video

  • @LunarRunner
    @LunarRunner 11 місяців тому

    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!

  • @mobileking3911
    @mobileking3911 Рік тому +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.

    • @MrSocialPirate
      @MrSocialPirate 3 місяці тому

      Without seeing your code it will be difficult, but most likely could be an error in the HTML elements id (if you have used a different id)

  • @Clash-Roblox
    @Clash-Roblox Рік тому +1

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

  • @SinanBayar-v1u
    @SinanBayar-v1u Рік тому +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?

  • @NahuelBorromeo
    @NahuelBorromeo 10 місяців тому

    Amazing bro, thanks for the tutorial!

  • @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

  • @blankspace4416
    @blankspace4416 Рік тому

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

  • @euclidesperez9682
    @euclidesperez9682 Рік тому

    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?

  • @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.

  • @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...

  • @hussein7990
    @hussein7990 Рік тому +1

    Love ur channel , keep it up

  • @TutoMaster
    @TutoMaster 7 місяців тому

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

  • @alexandraweather4156
    @alexandraweather4156 8 місяців тому

    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?

  • @sanketsingh5555
    @sanketsingh5555 Рік тому +1

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

  • @TLTechbender
    @TLTechbender Рік тому +1

    Thanks, This was so much helpful.

  • @Peace-hr6eo
    @Peace-hr6eo Рік тому +1

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

    • @sagarbhagat6475
      @sagarbhagat6475 5 місяців тому

      carousel.scrollLeft -= firstCardWidth. This can lead to slide your images from LEFT to RIGHT

  • @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: ua-cam.com/video/QtwXQdlvyWA/v-deo.html

    • @umarcse8985
      @umarcse8985 Рік тому +2

      @@CodingNepal yeah. Got it. Thanks

  • @riteshcgiri
    @riteshcgiri Рік тому

    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?

  • @getachewchala3942
    @getachewchala3942 11 місяців тому

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

  • @musahkamara
    @musahkamara Рік тому +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 Рік тому +2

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

    • @Justhue
      @Justhue Рік тому

      I encountered the same problem@@mobileking3911

  • @ebmpinyuri
    @ebmpinyuri Рік тому +1

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

  • @mariajegan2409
    @mariajegan2409 Рік тому +1

    Bro this is AWESOME 😎👍

  • @VermaCoder
    @VermaCoder Рік тому

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

  • @peterzhao9158
    @peterzhao9158 2 місяці тому

    Great. lean a lot from this.

  • @kertosyt
    @kertosyt Рік тому +1

    this is very helpful ! thanx

  • @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.

  • @hanma83292
    @hanma83292 Рік тому

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

  • @WolfGSk
    @WolfGSk Рік тому

    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.

  • @pablonavarro6263
    @pablonavarro6263 Рік тому

    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 Рік тому

      U might have given height to it , please check that

  • @DDK808
    @DDK808 Рік тому +2

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

  • @aryatands2728
    @aryatands2728 Рік тому +1

    Good Job bro...amazing

  • @РустамКаримов-я1щ
    @РустамКаримов-я1щ 5 місяців тому

    This is a great lesson! Thank you!
    But a problem arises if you open such a slider directly on your smartphone.
    If you open this slider via a smartphone (both in Chrome and Safari), when you scroll using the arrows, the slides shift.
    That is, the second and subsequent slides are not fully displayed.
    For screens with a screen width less than 480px, I specified gap: 0px - it helped (but it’s a crutch)
    But for tablets with a screen smaller than 900px it does not help. There gap was left with the same value.
    I thought it was my conflicts and typos. But no. I opened your demo on a smartphone and tablet. A shift occurs.
    Has anyone encountered this? How to solve a problem?

  • @smpnegeri3bangkalan681
    @smpnegeri3bangkalan681 Рік тому

    Hi bro, is itworking for blogspot?

  • @JulioCesar-hh9wq
    @JulioCesar-hh9wq Рік тому +1

    Dude, thanks a lot 10/10

  • @Nitay-rus
    @Nitay-rus Місяць тому

    Very good. Thank you!

  • @parmaraakash9822
    @parmaraakash9822 4 місяці тому

    thank you your video vary use full for me

  • @herewegoeth
    @herewegoeth Рік тому +1

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

  • @aliadrian2772
    @aliadrian2772 3 місяці тому

    thank you so much for this amazing video I have learned many think from it 🌹

  • @maryamseifi5957
    @maryamseifi5957 Рік тому

    Thank you please make it's pagination buttons

  • @НиколайЮськов-ш2г

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

  • @erturkyorulmaz7376
    @erturkyorulmaz7376 Рік тому

    Can't reach code?!

  • @Daily_problemsr
    @Daily_problemsr Рік тому +1

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

  • @agamemnon-Fr
    @agamemnon-Fr Місяць тому

    Awesome ! Thanks.

  • @sibadatta1990
    @sibadatta1990 Рік тому +1

    Wow, u made it so simple. Thanks a lot

  • @zamster_malik
    @zamster_malik Рік тому

    thanks u much for giving code

  • @Techtalkswithnonny
    @Techtalkswithnonny Рік тому

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

  • @sucess369
    @sucess369 Рік тому +1

    Dai euta Q&A video chaiyo k hamlai

  • @doBe1029
    @doBe1029 8 місяців тому

    "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."

    • @yume3119
      @yume3119 5 місяців тому

      I just had this problem but it was easy to solve, I just had to create two functions: the first sets the values of card_width and card_per_view and is called when the page loads or when the display is resized. The second removes the clones from the cards (if they exist) and creates new clones based on the updated values and is called within the first function.

  • @husnamert477
    @husnamert477 Рік тому

    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

  • @rafaelmoreira6160
    @rafaelmoreira6160 Рік тому

    Obrigado, ajudou no meu projeto.

  • @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 🙏

  • @ayubish
    @ayubish 4 місяці тому

    Thank you!

  • @llibanogs
    @llibanogs Рік тому

    really helpful thx

  • @amircahyadi9219
    @amircahyadi9219 Рік тому +2

    First ❤

    • @CodingNepal
      @CodingNepal  Рік тому

      Great! Hope you enjoyed the video.

  • @maxgamer6476
    @maxgamer6476 Рік тому +1

    Aaaaaaaah men damn damn keep going

  • @selonraymond6651
    @selonraymond6651 Рік тому

    Brillant !

  • @dawnscript
    @dawnscript Рік тому

    Wow awesome

  • @deepbhattacharyya7980
    @deepbhattacharyya7980 Місяць тому

    Please make e full screen image slider 😅

  • @rtxgamelab.official
    @rtxgamelab.official Рік тому +2

    I thought you were one of these someone
    😕😕

  • @rajinsakha07
    @rajinsakha07 Рік тому

    Thank you

  • @dyascoding7704
    @dyascoding7704 Рік тому

    thank you very muc

  • @emaesee4284
    @emaesee4284 11 місяців тому

    scroll-behavior: smooth; don't work

  • @ozodbek_developer
    @ozodbek_developer 7 місяців тому

    great

  •  Місяць тому

    Great video on image slider. Is anyone here working on program developer? please message me.

  • @frontend_ko
    @frontend_ko Рік тому

    great great

  • @Ayush37262
    @Ayush37262 4 місяці тому

    The CSS 💀

  • @CecilitaB
    @CecilitaB Рік тому

    i love you

  • @onceonce_studio
    @onceonce_studio Рік тому

    la madre para los mudos con voz

  • @mysearchhero
    @mysearchhero Рік тому +1

    Asowme

  • @RuiBorda
    @RuiBorda 2 місяці тому

    dislike por no poner codigo

  • @DesiTonyFaimly
    @DesiTonyFaimly 6 місяців тому

    Nice bro