How to Make Scrollable Sticky Sidebar in 5 Minutes
HTML-код
- Опубликовано: 30 янв 2023
- In this episode we're going to talk about how to make a scrollable sticky sidebar (A sidebar that scroll along with main content normally but become "sticky" or "fixed" when reaching the end of sidebar)
Source Code: redstapler.co/how-to-make-a-s...
******** Follow us on ********
Facebook: / theredstapler
Website: redstapler.co/
Twitter: / redstapler_twit
#webdesign #javascript - Наука
thank you, man. helped me a lot. But one thing I want to add is when the page is scrolling up, the scrolling action does the same action for the sidebar, not when it reaches the top. You know, like the reverse of scrolling down that before reaching the bottom of the section, the sidebar is scrollable. How can I do this?
thanks for this, it definitely helped!
i actually came to find sth different but this thing felt soo cool to learn so just watching it basically.. thankyou
Superb
hey is it possible to sycronise the end of the scroll ?
Cool
Helpful video 👍
#webcoder
wow, may thanks
hey,can you show ho to do it with react please?
left part : A, B, C...
right part: 1, 2, 3...
Want to see A and 7 at the same time? Or R and 1 at the same time? Sorry, you can't.
It's a good exercise what you did, but it's terrible UX design. Your right part should be fixed, top and bottom 0 with an overflow auto. There was no need for Javascript when a single small CSS class would have done a better job.
Why do not use position: sticky for this? Is there any problem with this property?
With position sticky you can stick it to the top or to the bottom. But not both.
@@timgreller ah, ok, i did not realize about the bottom sticky. Thanks for the answer
Is it possible to make with just css?
Yes, make it fixed with a top 0, a bottom 0, an overflow auto. His concept has a massive flaw, you can't see both the top part of the left side and the bottom side of the right part at the same time (and vice versa). His solution is to have 1 scroll to do 2 things... Meaning that no matter what you're trying to achieve, you will interfere with the other part. So, my technique will have 2 scroll bars, one for the page, another one for the side bar but this is how it should be.
How do you make it such that if you scroll up on the body you will scroll up on the sixebar so long has you have room, meaning you don't have any lag due to the container of the sticky div.
Dies sollte ohne JavaScript mit css umsetzbar sein… mit sticky