R
R
Ruslan Dasaev2021-04-28 11:41:34
css
Ruslan Dasaev, 2021-04-28 11:41:34

Are there ready-made libraries or examples in the sandbox for changing the picture on the phone when scrolling the page?

Good day, colleagues! Has anyone come across a similar case, where the phone is in place and when scrolling, the pictures inside change, in their work https://www.apple.com/apple-news/ 60891eec31208132257978.png ? You need exactly the same behavior. Are there ready made solutions for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergski, 2021-04-28
@sergski

Set the phone to position: sticky, loop through the position values ​​of all text blocks getBoundingClientRect, get the current scroll value window.pageYOffsetand compare with the current position of the text block. By condition, change the class of the phone. Profit)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question