Skip to content
Advertisement

Make a div smaller when scrolling

Hi i tried to make the div smaller wqhen scrolling. however i found some article that the div is small then when scroll it make bigger. i wanted the opposite. when run the image is 100% then when scroll it will be smaller. can someone help me please? i am new to this

This is the code:

https://codesandbox.io/s/sharp-lewin-to1o2b?file=/index.html

Html:

JavaScript

Advertisement

Answer

I did it with my math logic

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement