forked from microsoft/TypeScriptSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparallax.html
More file actions
98 lines (88 loc) · 2.36 KB
/
parallax.html
File metadata and controls
98 lines (88 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
#plaxHost {
height: 2000px;
background-color: Black;
}
#plaxHost div {
width: 95%;
}
#plax1 {
position: fixed;
color:White;
height: 2000px;
background-image: url(starfield2.png);
top: 0;
left: 0;
z-index: 1;
}
#plax2 {
position: fixed;
height: 2000px;
background-image: url(starfield.png);
background-position: 1087px 0;
top: 0;
left: 0;
z-index: 2;
}
#plax3 {
position: fixed;
height: 2000px;
background-position: 577px 0;
background-image: url(starfield.png);
top: 0;
left: 0;
z-index: 3;
}
#plax4 {
position: fixed;
height: 2000px;
background-position: 337px 0;
background-image: url(starfield.png);
top: 0;
left: 0;
z-index: 4;
}
#plax5 {
position: fixed;
height: 2000px;
background-position: 145px 0;
background-image: url(starfield.png);
top: 0;
left: 0;
z-index: 5;
}
</style>
</head>
<body>
<div id="plaxHost">
<div id="plax1">
</div>
<div id="plax2">
</div>
<div id="plax3">
</div>
<div id="plax4">
</div>
<div id="plax5">
</div>
</div>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="parallax.js"></script>
<script type="text/javascript">
var p = new Parallax.ParallaxContainer(window, 0.7);
for (i = 1; i <= 5; ++i) {
var star_layer = new Parallax.ParallaxSurface(document.querySelector('#plax' + i));
p.addSurface(star_layer);
}
</script>
</body>
</html>