Bootstrap 5 Carousel Multiple Items Responsive

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ม.ค. 2025

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

  • @nick231446
    @nick231446 ปีที่แล้ว +11

    This was very clear and easy to understand, words can't say how much I appreciate this so I ill just give this video a thumbs up, a subscribe and all notifications clicked.

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

    Thanks for this video, got it working after a few failed attempts, just typos on my part! New subscriber here for sure!!

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

    Awesome video. Not much out on this topic, this helped me out. Thank you.

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

    Great video! This is exactly what I was needing!

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

    how do we select all the image cards at once???? please lmk

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

      Not quite sure, but are you looking for something like this (3 cards at once) th-cam.com/video/kHPm_AlxP7U/w-d-xo.html

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

    it did not work for me , i followed you step by step but always stuck in the minute 1:21 , still one card only appear for me

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

      are you using carousel-item div for each card?

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

      @@codingyaar yes

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

      Try without the media query. There's also a step by step explanation on the site. If you are still stuck, you can share your code on discord.

    • @NeenuJose-ov7ng
      @NeenuJose-ov7ng ปีที่แล้ว +3

      I got this error, for me the positioning of the CSS file was the issue. Once I placed it after Bootstrap CSS it got fixed.

  • @brightblue
    @brightblue 2 ปีที่แล้ว +3

    Hello and thank you very much for sharing this.
    I have been trying without luck to hide one the controls when you are on the first or the last item (since you cannot go any further it does not make sense to have the arrow) . Do you have any suggestions how one can do that ? (I actually manage to hide it but if I do, I cannot put it back once I am on the second card or once I have moved back to the second last)

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

      Just like we check to stop going further, use an if statement to check if the scrollPosition is less than or equal to zero to hide the prev button and similarly for the next one.
      Update: Here's how you can do it
      th-cam.com/users/shortsl8E_1pL-Soo?feature=share

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

    the best and fastest tutorial, thank you!

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

    your idea is excellent , first put card then put carousel, because in build carousel size not customize

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

    Great video! Nice work.

  • @parthsapariya-rb2wb
    @parthsapariya-rb2wb 3 หลายเดือนก่อน +1

    only one image is show

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

    I followed the tutorial to the end, but the next and previous controls are not in the correct position, can you check my code?
    control position is on top of the card, not next to it

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

      @LEA ALYU 04 Sure. You can share your code on discord. I'll have a look.

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

    Thank you so much!!! Great video

  • @EvgenyPrigozhinDEV
    @EvgenyPrigozhinDEV ปีที่แล้ว +11

    what happend to you that u came here to see an indian tutorial?

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

      Internship 😅😅

    • @anu.jangra
      @anu.jangra 11 หลายเดือนก่อน

      Internship 😅

    • @uchihabolt
      @uchihabolt 9 หลายเดือนก่อน

      Internship 😅😅

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

    Thank you so much! This tutorial was really helpful

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

      Happy to help 🙂

  • @parthsapariya-rb2wb
    @parthsapariya-rb2wb 3 หลายเดือนก่อน

    all propertise use but multiple image is not show please help

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

    Thank you very much for your great unique solution!
    It works in Joomla 4 with Bootstrap v5.1.3 and jQuery v3.6.0. It means that we can make carousel just with standart tools of Joomla.
    It didn't work at first and I have error in Firefox: Uncaught TypeError: can't access property "scrollWidth", $(...)[0] is undefined
    and in Chrome: Uncaught TypeError: Cannot read properties of undefined (reading 'scrollWidth')
    But the author gave advice to place the script after the HTML or wrap the script in:
    $(document).ready(function () {
    //jQuery code
    });
    and it started to work!

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

    Great video.. can It be done with java instead of jquery?

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

      Why would you use Java for that? Do you mean JavaScript?

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

      @@codingyaar sorry, yes. I meant JavaScript....

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

      The website(link in the description) has a pinned comment below with vanilla JavaScript code.

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

    I don't want the cards stop scrolling when they reach at the last. So, how can I use loop for them?

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

      You could add an else block and set the scroll position to 0 when you've reached the last card.

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

    tried this same example but the card is not sliding away. it slides away and then back to the same position

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

      Have you checked the classnames? Are you using a Bootstrap 4 carousel?

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

    why when i delete "slide" ini html , the card can't move. If i not delete it, it's move but just move to the side and back again to the first position?? can you help me...

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

      It's the opposite of what should be happening. Have you included the jQuery code properly?

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

    Awesome thank you so much!!! 💯

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

    if you are still here thanks for watching !! bolneka tharika thoda casual hai🤣💚

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

    hi i have a problem: when i click next or previous button, it only moves one card then it go back to it places, it moves like a wave, it doesnt move all carousel, please help me

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

      Moves like a wave? Sorry! I don't get what you are saying.

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

      @@codingyaar its is very difficult to say:when you press next or previous button only 1 card move at a time, example when I press right, first card move to the right then move back to old position, press right again and the second card move like that. I set the bound is 4 cards, the cards from 5 and beyond never move to the screen. it is very hard to say because I'm not good at English

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

      ​@@Strongest845 still not sure but please recheck:
      - use the correct carousel for the respective Bootstrap version
      - check if you are using minified version of jQuery (which should be linked before the Bootstrap js link)
      - also check if you have removed the slide class from the carousel HTML

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

      @@codingyaar ok so my error is look likes your steps 3 and 4 output on this video website source code, even though i followed your tutorials

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

      @Manh Pham I've created a discord server for the queries that are difficult to solve in comments. Can you share your code or ss there?

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

    Hi! Thanks for the video. Should this work with the new version of bootstrap?

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

      Yes, it does work with the new Bootstrap version.

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

    Thank you, miss!

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

      You're so welcome!

  • @pedropaulo5576
    @pedropaulo5576 9 หลายเดือนก่อน

    if I try to add 2 carousels for different topics the button prev and next changes all carousels

    • @codingyaar
      @codingyaar  9 หลายเดือนก่อน

      Here's how to manage multiple carousels on same page: th-cam.com/video/NTwYWKRfO3E/w-d-xo.html

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

    Which software are you using ma'am?

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

      Visual Studio Code

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

    CUANDO LO PONGO REPONSIVE LAS IMAGENES SE MUEVEN SOLAS Y RAPIDO. ¿ ME PUEDES AYUDAR? GRACOIAS

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

      You'll have to use some JS to detect when the screen size changes to avoid that.

  • @tathyfigueroa7996
    @tathyfigueroa7996 6 หลายเดือนก่อน

    this is not working for me and i dont know why :( can you help me? none of this is working, the carrousel keeps displaying the same

    • @Maxim99t
      @Maxim99t 5 หลายเดือนก่อน

      maybe bootstrap overwrites your styling, make sure to use !important.

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

    Hello, so in my project, I want to have 2 carousels in one page, i tried and when i click on prev/next button of the second carousel my first one moved also, but when i click the one from the first carousel it works fine, the second one doesnt move at all (nomalr), how to fix it? Awesome video btw, very helpful!

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

      You need to have unique ids for both. If their ids are the same, the controls will work for the first one on that page. You would also need to add the second id in the JS and wherever it's used.

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

    Hi, thanks for this great video, but i am facing problem when using ngFor for carousal items, the navigation button is not working, i tried ng-container too but still its not working

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

      It does work with ngFor. Are you getting any errors?

  • @thesandman-f3l
    @thesandman-f3l 11 หลายเดือนก่อน

    hi. this not working. left right button animation.

    • @codingyaar
      @codingyaar  10 หลายเดือนก่อน

      Sorry for the late reply. Did you manage to make it work?

  • @pedropaulo5576
    @pedropaulo5576 10 หลายเดือนก่อน

    best of all time

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

    you saved my time thanks!

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

      Glad to hear that! 🙂

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

    Amazing Thanks :)

  • @NeenuJose-ov7ng
    @NeenuJose-ov7ng ปีที่แล้ว

    For me it is not working as responsive

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

      are you getting any errors?

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

    i dont have any errors on the console

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

    i'll try this code but slider can't move in my code when i click on next can you help me?

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

      are you getting any errors in the console?

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

      @@codingyaar yes error will in carousel.js file

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

      this error occur
      Uncaught TypeError: Cannot read properties of undefined (reading 'keyboard') carousel.js:206
      at at._addEventListeners (carousel.js:206:22)
      at new at (carousel.js:104:10)
      at slider.js:4:18

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

      what's on that line? Have you checked if you are using anything that's undefined?

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

    How to do it in react ?

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

      Sorry, I don't know that one

    • @samoli02
      @samoli02 11 หลายเดือนก่อน

      It's ok bro

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

    how to make 3 items slide at same time

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

      As mentioned on the website, you need to multiply the cardwidth by 3:
      scrollPosition += cardWidth * 3;

  • @cripto-moedas
    @cripto-moedas ปีที่แล้ว

    LOVE U SOME MUCH GOT IT

  • @Usaid-u5u
    @Usaid-u5u ปีที่แล้ว

    Thank you

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

    Nice video help me a lot

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

      Glad to hear that😊

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

    his not work in apply this css
    .carousel-inner{
    display: flex;
    }
    .carousel-inner .carousel-item{
    display: block;
    margin-right: 0;
    flex:0 0 calc(100%/3);
    }
    pleas help mein i follow same pattern

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

      Are the cards not displayed properly or the controls are not working?

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

      same error css is not working for me, card stil 1

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

    thanks

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

    thank you

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

    If you are still here.... then ????? hahaha

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

    show mobile view

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

      8:35 is the mobile view

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

    I have an error:
    site.js:124 Uncaught ReferenceError: bootstrap is not defined
    at site.js:124:20
    where this line is:
    $(multipleCardCarousel).addClass("slide");
    Someone know how to solve this?

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

      Have you not linked Bootstrap's JS?

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

      @@codingyaar Yes:

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

      🤔 try using the CDN link to check you have the right path

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

      @@codingyaar i used and then it works on mobile but dont on desktop. I have two links and it works with strange animations but... works :v with some errors but works

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

      Make sure you have included jQery link before bootstrap's JS just before