"Different" Parallax scrolling effect

I work in my new portfolio, and I want to make such an effect on the site:

http://nizoapp.com/

The effect of the iPhone and parts that appear on the sides when scrolling. This is a kind of parallax scrolling.

I tried to search but cannot find. So I β€œstole” the code, which saves the page and adapt the code, but it seems to have a lot of unnecessary things.

Does anyone know how I can do this?

+3
source share
3 answers

Parallax: the apparent displacement of the observed object due to a change in the position of the observer.

Parallax is one specific scrolling effect that simulates depth with relative scrolling, for example .

, round-ups.

+4

The idea that i came up with.

, , . , / . , - . , ( , ). .

"", - "". :

D = > A k = > a > 1 ( )
y = > (document.body.scrollTop)
dy = > A, C
dx = > . A C
theta = > ( ) A, C

C A, - ( - ). , y , D . , D /, . , /, D . dy, dx , css C ( ). , dy, dx, .

dy = Math.sin(theta) * D
dx = Math.cos(theta) * D

, . , , - ... , ...:)

+3

basically it uses the event scroll, and then at certain points it animates the fields.

0
source

All Articles