⏮
◀
▶
⏭
◎ Generic page type
Home
Grid Layouts
Blob - A blob is a splash of substance
barepage23
3d model
barepage
Selector
textareas
Swipers and Carausel
Bullet List Points
Figures
Accordion
Animated Text
Codepen Top Code deposits
Thumnail stuff
bbgrid
Svg Intro
Responsive Table
responsive masonry
calcul8
admin_interface_starter
multicolumresponsivediv
CSS-Based-Capcha
GOOD NEWS CSS
Tree Layouts Sitemaps
Shoppingcart
sticky CSS
lazareth
Laz21
CSS Transitions SectorA
Chat2me
weadobe
tryme
interstellar
Paralax
Type A
TypeB
Type C
Type D
Type E
Type F
Type G
Type H
Type I
Type J
type L
Type M
mplax
smooth scroller
Page Script Functions
anchor css
Objects
Navigation
Quick Site Scroll
purecssscroll
date_Javascript
Menu Items
Loaders
Pricing
Currency
Generic page type
Paralax Posted on:
Going back to our HTML, we see that even though we scaled the image up so that it would be perceived at the same size, the element has a certain offset from the top. Let’s try correct this by solving for the top gap
x
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
x
x
:
h
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
h
h
is the height of the element in the background (
E
F
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
E
F
E
F
)
s
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
s
s
is the scale applied. So,
s
.
h
=
E
2
F
2
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
s
.
h
=
E
2
F
2
s
.
h
=
E
2
F
2
v
2
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
v
2
v
2
is half the height of the viewport
e
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
e
e
is the vertical distance from the perspective origin to the element center, and
e
1
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
e
1
e
1
its projection on the viewport
1
+
z
p
-
z
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
1
+
z
p
−
z
1
+
z
p
-
z
is the factor any height at
z
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
z
z
distance is multiplied with to result in the projected height.
Using the constraint that on the viewport projection:
x
+
E
2
’
O
’
+
e
1
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
x
+
E
2
’
O
’
+
e
1
x
+
E
2
’
O
’
+
e
1
is half of the viewport:
x
+
s
2
⋅
h
⋅
(
1
+
z
p
-
z
)
+
e
⋅
(
1
+
z
p
-
z
)
=
v
2
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
x
+
s
2
⋅
h
⋅
(
1
+
z
p
−
z
)
+
e
⋅
(
1
+
z
p
−
z
)
=
v
2
x
+
s
2
⋅
h
⋅
(
1
+
z
p
-
z
)
+
e
⋅
(
1
+
z
p
-
z
)
=
v
2
x
=
h
2
⋅
(
1
-
s
)
+
h
⋅
z
⋅
1
-
s
2
⋅
(
p
-
z
)
–
v
⋅
z
2
⋅
(
p
-
z
)
" role="presentation" style="box-sizing: border-box; display: inline; line-height: normal; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">
Copyright © - |
|
NR