How to Scroll Horizontally in React JS - Styled With Tailwind CSS - Javascript

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

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

  • @JJ-ot3ps
    @JJ-ot3ps 2 года назад

    great video! been looking for this for a while!

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

    Exactly what I've been looking for! Thanks man ❤

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

    Thanks for this explanation. Clear and precise. Made me also realize tailwind would be ugly and annoying to use in projects. Extensive lines of styling all over the place makes everything look chaotic

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

    Loving the new branding ! Code commerce ftw.
    Really appreciate your content man.

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

      Appreciate it! I was thinking of changing the name of the channel to my full name - not sure yet.

  • @mohanadoo
    @mohanadoo 2 года назад +1

    Thanks for sharing this was very useful and easy to implement and you explain the steps very well 👍

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

    Amazing and helpful ty😭

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

    short easy at the point and perfect that what can i say about this video thanks

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

    Very helpful! Thanks man 🙏🏻🙏🏻

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

    greately explaine brother......

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

    brother it's helpful I hope for you success

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

    I LIKE YOU CUZ YOU GOT THAT SOMETHING THAT I NEED IN MY LIFE SO GIVE IT TO ME!!!

  • @DevIsrael
    @DevIsrael 9 месяцев назад

    thanks man, kudos to you

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

    Very usefull! Thanks for sharing

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

    nice video. thank you

  • @fatimaiqra2169
    @fatimaiqra2169 6 месяцев назад +1

    thanks a lot!

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

    that is what i wanted thanks alot

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

    thank you. very helpfull

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

    What if i want to write something below the image? I noticed that if i add a h1 tag after the img tag the layout breaks.

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

    Thank you.

  • @PraveenMaurya-no6nf
    @PraveenMaurya-no6nf 9 месяцев назад

    i want that. Thanks. Can we do the same with tailwind css in more easy way

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

    thank you for the tutorial video,
    How do we disable buttons when we are at the first element and last element on the screen?

    • @rahulkumar-yk2ru
      @rahulkumar-yk2ru 9 дней назад

      Not sure, but what if we loops through index & find first & last items index

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

    Thank you very much

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

    muchas gracias ! me sirvio de mucho

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

    Awesome video +++++++++++++++++ 😃

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

    please tell me how to add infinity autoplay slide

  • @ngc918
    @ngc918 2 года назад +1

    Hey there. I implemented this into my portfolio after watching your portfolio video. I love how it came out! However, for some reason my image gallery goes over my navbar when I scroll down. Any solution for that?

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

      Awesome! Check the positioning & z-index in CSS :)

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

    I was looking for the same can we add videos instead of images ? Can please make a video on that how can we add videos in this slider?

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

    Hi boss, I implemented the code but in my browser it showing uncaught runtime error
    cannot read properties of null (reading '''scrollLeft'') can you help

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

    hi great channel ; - ) i have rect+vite-tailwind , but there is a problem with local img not showing up, even after import, when I import from http it works

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

    Is this menu scroll-able with touch screens? I mean is it possible to swipe left and right in mobile devices without clicking the icon buttons?

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

    I tried to add a div that wrap the img tag but again the layout breaks.

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

    thank you

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

    can scrollLeft be modified ?

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

    Isn't there any other way to achieve this, I mean without using a querySelector? Shouldn't we avoid using querySelector in React? Looks somewhat hacky to me. However, I still appreciate what you've done. Thanks

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

      Mounis - you are correct, a bit hacky. Perhaps I’ll do a follow up video with useRef

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

      @@codecommerce that'll be great

  • @notagant47
    @notagant47 9 месяцев назад

    I have followed all your code and it's still not working, is it because I use typescript and and Next js ? the javascript is not running smooth at all only jumping and jumping when I scroll.

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

    Can I do that without Tailwind?

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

    How can we scroll on touching the items?

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

    Sir Can you please try this with videos??

    • @codecommerce
      @codecommerce  2 года назад +1

      Good idea pingu

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

      @@codecommerce I have tried this with videos with tailwind css and it worked.😊

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

      @@codecommerce sir one more thing can we connect multiple pages in reactjs. And also full website with frontend and backend

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

    not reponsive ?

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

    so I used the scroll function exactly like you showed in the video, but its not working..
    I am using nextjs with typescript, but here is the code:
    const slideLeft = () => {
    let slider: HTMLElement = document.getElementById('slider')!
    slider.scrollLeft = slider.scrollLeft - 500
    }
    const slideRight = () => {
    let slider: HTMLElement = document.getElementById('slider')!
    slider.scrollLeft = slider.scrollLeft + 500
    }

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

      U ARE Fix this ? I have the same issue

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

      @@daotieesn Yeah you need to wrap a div around the div that has the slide function.

  • @Hoid1014
    @Hoid1014 9 месяцев назад

    God

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

    Appreciate your efforts man
    Everything sounds good excpet getelementbyid. Dude you are manipulating the DOM directly which we should not do in React JS

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

    thats not realy optimised.. 2 function for that please only 1 is needed... and why getElementByid please use useRef with hooks

    • @kamaboko1
      @kamaboko1 2 года назад +2

      Make your own tutorial and post it.

    • @usmanrangrez-cd7zj
      @usmanrangrez-cd7zj Год назад +1

      const sliderRef = useRef(null);
      //use this is your element
      ref={sliderRef}
      const slideLeft = () => {
      sliderRef.current.scrollLeft -= 500;
      };
      const slideRight = () => {
      sliderRef.current.scrollLeft += 500;
      };

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

    Pls sir use bootstrap css, in india developer don't use tailwind css

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

      Oh no I hate using bootstrap! haha. I'll try and use it a least once in a video :)