Проблема синхронизации перехода при скольжении одного окна по другомуCSS

Разбираемся в CSS
Ответить
Anonymous
 Проблема синхронизации перехода при скольжении одного окна по другому

Сообщение Anonymous »

конкретная проблема: < /strong>

a React Components с эффектом прокрутки окна через существующее окно слева было реализовано с использованием синхронизированного перехода 3 дочерних элементов. As i understand, synchronization is not perfect so there is an effect of the existing window "shivering" while the left window is scrolling on it.

Desired behavior:

The existing windows should be stable while the left window scrolls over it.

Sample code that demonstrates the problem:

React Код: < /p>
const TestWindow = () => {
return (



What is Lorem Ipsum?

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only
five centuries, but also the leap into electronic typesetting,
remaining essentially unchanged. It was popularised in the 1960s with
the release of Letraset sheets containing Lorem Ipsum passages, and
more recently with desktop publishing software like Aldus PageMaker
including versions of Lorem Ipsum.




Why do we use it?

It is a long established fact that a reader will be distracted by the
readable content of a page when looking at its layout. The point of
using Lorem Ipsum is that it has a more-or-less normal distribution of
letters, as opposed to using 'Content here, content here', making it
look like readable English. Many desktop publishing packages and web
page editors now use Lorem Ipsum as their default model text, and a
search for 'lorem ipsum' will uncover many web sites still in their
infancy. Various versions have evolved over the years, sometimes by
accident, sometimes on purpose (injected humour and the like).



);
};
export default TestWindow;
< /code>
css:
< /p>
.test-window {
display: flex;
background-color: white;
--test-width: 50rem;
--left-width: 1rem;
width: var(--test-width);
max-width: 90vw;
border-radius: 8px;
}

.test-window:hover {
--left-width: 15rem;
}

.test-left-container,
.test-left,
.test-right {
transition: transform 0.3s, max-width 0.3s;
}

.test-left-container {
overflow: hidden;
max-width: var(--left-width);
}

.test-left {
width: var(--test-width);
transform: translateX(calc(var(--left-width) - 100%));
padding: 1rem;
border: 1px solid green;
}

.test-right-container {
flex: 1 1 auto;
overflow: hidden;
width: calc(100% - var(--left-width));
}

.test-right {
width: var(--test-width);
transform: translateX(calc(var(--left-width) * -1));
padding: 1rem;
border: 1px solid green;
}
< /code>
Идея состоит в том, чтобы перевести как левое окно (наложение), так и правое окно (существующий), поэтому всегда видно их правая сторона.
В примере кода прокрутка инициируется парящей над окном. />

thanks.

Подробнее здесь: https://stackoverflow.com/questions/797 ... er-another
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «CSS»