CSS Scroll Snap

Поділитися
Вставка
  • Опубліковано 29 бер 2021
  • Learn how to control scroll snapping for you web galleries with the CSS scroll-snap property. Scroll snap is relatively new and makes the animation and transition between slides much smoother for gallery or card like content transitions.
    💖 SUBSCRIBE (Please) 💖
    ua-cam.com/users/FollowAndrew?s...
    Live Scrimba Code: scrimba.com/scrim/coe9643ac9e...
    🙏 Become a Patron for support! 🙏
    / followandrew
    📢 Social Media 📢
    TWITTER (@followandrewedu) ➞ / followandrewedu
    #css #webdev #tutorial

КОМЕНТАРІ • 34

  • @hasansolak23
    @hasansolak23 2 роки тому +13

    For those who have struggled to make the code work... I realized that I forgot to set the container's height to its child height. For example, each of my child elements has a height of 100vh, I set the container's height to 100vh and it worked...

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

    Thank you! This works perfect for what I need.

  • @metron2590
    @metron2590 2 роки тому +9

    this does not work for me for some reason, the scroll snap just doesnt work

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

      add the overflow:auto; property and it works

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

    Is there a way tincrese the delay for teh snapping ? scoll snap time ? It feels ages when the snaps kicks in

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

    How to actually make a different look af that scroll bar on the side, different thickness and colour, add/remove arrows? Thank you

  • @mendistudio
    @mendistudio 3 роки тому

    Very simple and effective tutorial thanks. So after scrolling the scroll-area through you can continue scrolling the other elements below right? I thought this was done with gsap or similar.

    • @FollowAndrew
      @FollowAndrew  3 роки тому

      Yep, that's correct. Super smooth animations too for the scrolling, as it's done in CSS and can be accelerated on the GPU.

  • @badcatdesign
    @badcatdesign 3 роки тому +1

    @2:12 cannot see the properties dropdown in the YT vid - something's not playing nice with the scriba recording.

    • @FollowAndrew
      @FollowAndrew  3 роки тому

      Yeah, I noticed this in post as well. Not sure why the playback doesn't show that.. I've come across a time or two when the live preview doesn't show properly on playback as well..

  • @vm9010
    @vm9010 3 роки тому

    Hi! Great tutorial. I have an issue - when the snap occurs it skips 1 section between (it jumps from section 1 to 3). Any idea why? Thank you in advance.

  • @nilachol4
    @nilachol4 2 роки тому

    when I scroll(in google chrome), it jumps two slides at a time :(

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

    Why this is not work on my Case,😢 btw on my Case i use grid to the container. Please explain to me.

  • @ralkey
    @ralkey 3 роки тому +1

    my scroll snapping overshoots from the 1st to the 3rd and also the other way. (i only have 3 alement to snap to)
    why does this happen and how do i fix it?

    • @aryancoderc4142
      @aryancoderc4142 3 роки тому

      same here, did you find any solution?

    • @ralkey
      @ralkey 3 роки тому

      @@aryancoderc4142 nope. i saw on stack overflow that its probably a problem with my google chrome version.
      so i updated it but it didnt fix it.

    • @aryancoderc4142
      @aryancoderc4142 3 роки тому

      @@ralkey mine is the last version too but it doesn't work, I tried on my laptop it works but not on pc with 28inch monitor, but it works perfectly on firefox

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

    I tried to add this scroll-snap to elementor custom css. It works in editor. but it doesn't work in preview and active page. Why?

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

      Have you figured it out?

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

      @@WTPleo i tried another way. if you want i can share it with you.

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

      @@tahirbalci yes please

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

    your screen recording has not captured the drop down list .

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

    nice

  • @MajdYafi
    @MajdYafi 3 роки тому +2

    Says I need permission to view the code in Scrimba

    • @FollowAndrew
      @FollowAndrew  3 роки тому +1

      Think I've got that link fixed, try again now?

  • @Dexter101x
    @Dexter101x 3 роки тому +2

    The sound kept cutting out

    • @SomeRandomPiggo
      @SomeRandomPiggo 2 роки тому

      didnt for me, think its a client side issue

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

      @@SomeRandomPiggo lol it's a video editing blunder, happened a couple times towards the end of the vid

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

    Not a really nice tutorial to be honest, it could have been a bit broader and a bit more creative... give us a nicer example so we can see how flexible the property actually is and what can be achieved with it... this gave me as much info as the first thing that pops up when you google 'scroll-snap-type'. also the sound switching off at some points is strange.

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

    Good job bro, JESUS IS COMING BACK VERY SOON;WATCH AND PREPARE

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

      is it gonna take long? how soon is it?