JavaScript: Implementing Horizontal and Vertical Scrolling on a Single Webpage

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

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

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

    King of advanced front-ends ✌🏽😁

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

    Thank you so much for this video and your whole channel! it was very helpful

  • @Артём-к6ю1г
    @Артём-к6ю1г Год назад +3

    Thanks a lot!!! 👍👍👍
    Very cool video.
    You told everything very detailed and clear!!!

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

    Super helpful
    Love the fact that you explained it so well❤

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

    ------------------------------ This is awesome! Thank You! ------------------------------
    To go with this, I am going to try to create a persistent sidebar (left, or right) that users can mouse over to go back to vertical scrolling no matter what their position in the horizontal scrolling area. Like a sidebar on the left that as you scroll down the page, it has images and project titles, on the bar. Then, use a scroll snap to snap to each project when centered on the project image and title on the bar. When you hit that point, the horizontal scroll kicks in to display all the project images. When the project images end, the vertical scrolling kicks back in, just like this video shows. At any position, the user can go back to the sidebar to enable the vertical scrolling again.
    I have the code for all of that. But, combining it with this code here is going to be a bi0tch. If I can accomplish this, it will be my dream portfolio for my architectural work.

  • @ajaykathait7633
    @ajaykathait7633 11 месяцев назад +8

    can you please provide the code as well

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

    This is awesome! Thanks Conor!

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

    Very elegant, going to use this !

  • @asdomain4503
    @asdomain4503 Год назад +4

    Was looking for this for months... thanks, great tutorial

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

    Thank you. I needed this.

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

    Thaks for all

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

    This is very creative. Clear tutorial.

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

    Awesome! Thank you bro! Please more videos like these :)

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

      More to come!

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

      @@ConorBailey
      .sticky__parent {
      height: 500vh;
      }
      .scroll__section {
      width: 500vw;
      }
      The question is how to calculate what height .sticky__parent should be and what width .scroll__section should be??
      percentage = percentage < 0 ? 0 : percentage > 400 ? 400 : percentage - where did we get 400?

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

      @@ob5804 we go to a max of 400 as we still want the final 100vw to remain on the screen. So 500vw - 400vw = 100vw. Does that make sense?

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

      @@ConorBailey I have 6 pictures, so percentage = percentage < 0 should be in the script? 0 : percentage > 600 ? 600 : percentage, and in styles .sticky__parent {
      height: 600vh;
      } .scroll__section {
      width: 600vw;} and the pictures are 400px, but still there is a lot of empty space after the pictures in .scroll__section(((

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

    Is This transitions are possible with fixed screen ? Means 1 slide view on entire screen on scrolling

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

    Thanks a ton Conor

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

    can this effect be achieved with lerp function for easing effect?

  • @truowng
    @truowng Год назад +5

    Amazing!!! I’ve been waiting for this for a long time. Thank you for sharing 🥰

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

      Thanks mate! Glad you find it useful 👍🤩

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

      @@ConorBailey Hi. Can you make tutorial of this? - - - - -> Image Grid on Scroll - Bricksbuilder - Bricksforge - GSAP - - - - -> this is the name of the video on RUclips because RUclips itself removes the link.

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

    is there any documentation for math being used within an html document. how do you make calculations to animate elements however your want.

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

    Thank you very much keep up the great work

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

    Thank you sir, i really appreciate your tutorial

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

    its a very good approach, but wouldnt it be better if the height follow the content inside instead of being defined from the beginning?

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

    This was really helpful, thank you very much.

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

    link code ?

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

    Can u add text between the images?

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

    hi Conor , if you can please could you do a tutorial using threejs and infinite scrolling gallery with different sized image planes

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

    top :0 not working after smooth scroll by lerp function, any help will be appreciated

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

    thank you for the tutorial, it works great! I have a question: What happens if the scroll container is not 100vh but has a static height like 500px? Is it possible?

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

    Cool, exactly what i need! Thank you!

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

    and if i use image that are in my folder howi can do it?

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

    Awesome! 👍

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

      Thanks mate. Always appreciate your support! Legend

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

    Amazing!!!!!!!!!

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

    great stuff. I learnt a lot thx

  • @DeepakSingh-n2g
    @DeepakSingh-n2g Год назад +2

    Why 500vh and 500vw? Why not 1000? Any reason for that number? What if I have 100 images?

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

      you can use that just adjust accordingly

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

    How to make the .sticky block have the width of the content in the .scroll__section block? I have 6 images
    .sticky__parent {
    height: 600vh;
    }
    scroll__section {
    height: 100%;
    width: 600vw;
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    gap: 50px;
    }
    img {
    width: 400px;
    height: 80%;
    object-fit: cover;
    object-position: center;
    }

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

    Thanks bro

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

    hey ! why translate3d and not translateX ? thx

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

      I read that using translate3d generally performs better / faster in most browsers here: stackoverflow.com/questions/22111256/translate3d-vs-translate-performance
      Although I don’t believe it makes too much difference to be honest 😅
      Cheers!

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

    Amazing, Conor! I've watched many of your videos, and you're truly an expert in Vanilla JS. Could you please share your learning path for JavaScript? Thank you!

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

    thanks.

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

    You are tooo goood

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

    You saved my day.

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

    thank you

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

    You actually do not need to set any width that equals the height anywhere. Also using transform is not that good as just setting the scrollX of our sticky scrollable component. Also no need to set `position: absolute;` to the child. Keep things simple.

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

      Cool cheers for sharing! Why don’t you make a video on it? Share your knowledge! You clearly know it all! 😉

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

      @@ConorBailey Now you know it as well. Enjoy ;)

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

    Belly belly good....they see me scrolling 😎😎

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

    😇