In my code, the scrolling gets stuck at the anchors, I need to keep scrolling down once…
- User
In my code, the scrolling gets stuck at the anchors, I need to keep scrolling down once the anchor is reached. Also before reaching the 10vh range of the anchor I want to be able to scroll to the opposite direction, however in this code when I scroll to the opposite direction before reaching 10vh close to the anchor which locks the scrolling, I still can't scroll. Here is my code: "
code.scrolling-anchor { height: 100vh; position: relative; } .scrolling-anchor::before { content: “”; position: absolute; top: -10vh; left: 0; width: 100%; height: 10vh; background-color: rgba(255, 0, 0, 0.5); } </style>code - Assistant
- User
ok you couldn't fix the scrolling in the opposite direction thing, but you fixed getting stuck at anchor. However there is a really bad mistake about this code. I want to scroll normal speed until the anchors 10vh range is reached then slow down as if hitting brake with in the 10vh that remans, for some reason your code slows down a ton before reaching 10vh and jumps the last 10vh. Let me explain what I am trying to do again with details; I am going to create a webpage that is like a slideshow. Each slide is 100vh. When scrolled I want to scroll next slide so I want to scroll 100vh. However while scrolling 100vh to the next anchor if user scrolls to the opposite direction I want to scroll back. For example while scrolling to next anchor mid way through, 50vh scrolled, if user scrolls to the opposite direction, I want to be able to scroll 50vh back to the opposite direction and reach the anchor. Another thing I am trying to the do is brakes system, to prevent user from scrolling constantly and having a nice animation when landing to the next slide, anchor, I want to have the last 10vh animated as if hitting a brake (slowing down) and I want user to be not able to scroll while this braking animation is playing.
- Assistant
- User
ok this works nice, however it has some bugs and needs adjustments. First of all in order to make the code work I am removing: " overflow-y: scroll;" from ".scroll-section ". Otherwise the code scrolls normally without functionality. However after I remove that line code works as expected. The first bug I observed is that when user scrolls at the edge of the slides, like at scrolling up at the first slide or down at the last slide, the scroll gets stuck. So we need to prevent user getting stuck at these edges. Going up at the first slide or going down at the last slide shouldn't stuck the user. Also the first slide seems to have a ::before, but there is no ::before of first slide, as it is the first slide. Also the scrolling canceling, works at the 10vh range instead of working at the 90vh range. So it is working as opposite of intended. Scrolling must be able to canceled at the 90vh range and locked at 10vh range. Also when scroll is locked, the scrolling creates a glitching scrolling effect, once the scrolling is locked scrolling shouldn't create any effect, I am not sure if it will be fixed once the bug defined in: "Also the scrolling canceling, works at the 10vh range instead of working at the 90vh range. So it is working as opposite of intended. Scrolling must be able to canceled at the 90vh range and locked at 10vh range. " is fixed.
- Assistant
- User
wait this just doesn't work, are you sure the lines: "window.scrollTo(0, start + (offset - start) * easeOut);" and "window.scrollTo(0, offset);" are correct
- Assistant
- User
- Assistant