Код: Выделить всё
html {
overflow-y: scroll;
scroll-snap-type: y mandatory;
scroll-behavior: smooth;
}
section {
height: 100vh;
position: relative;
color: white;
}
.bg-cyan {
background: cyan;
scroll-snap-align: start;
}
.bg-magenta {
background: magenta;
scroll-snap-align: start;
}
.bg-yellow {
background: yellow;
color: black;
scroll-snap-align: start;
}
.bg-key {
background: black;
scroll-snap-align: start;
}
.bg-red {
background: red;
}
.bg-blue {
background: blue;
}
.bg-green {
background: green;
}< /code>
CYAN
MAGENTA
YELLOW
BLACK
RED
BLUE
GREEN
См. Fiddle ... https://jsfiddle.net/joshmoto/ Qday0r9o/4/
Если я попробую использовать Scroll-snap-type: none; on .bg-red Раздел с использованием Asterisk Tilde, чтобы получить все элементы после .bg-red , ничего не происходит? Каждый раздел все еще защелкивается? См. Здесь ... < /p>
Код: Выделить всё
html {
overflow-y: scroll;
scroll-snap-type: y mandatory;
scroll-behavior: smooth;
}
section {
height: 100vh;
position: relative;
scroll-snap-align: start;
color: white;
}
/* Disable scroll snapping after .bg-red section */
section.bg-red ~ * {
scroll-snap-type: none;
}
.bg-cyan {
background: cyan;
}
.bg-magenta {
background: magenta;
}
.bg-yellow {
background: yellow;
color: black;
}
.bg-key {
background: black;
}
.bg-red {
background: red;
}
.bg-blue {
background: blue;
}
.bg-green {
background: green;
}< /code>
CYAN
MAGENTA
YELLOW
BLACK
RED
BLUE
GREEN
См. Fiddle ... https://jsfiddle.net/joshmoto/ mbey5p6s /38 /< /p>
Кто -нибудь может увидеть, куда я здесь ошибаюсь ...? < /p>
иметь возможность Отключить CSS, снимаясь после определенной точки, если это возможно?
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/761 ... tain-point
Мобильная версия