質問編集履歴

1

コードを追記しています

2019/09/25 10:21

投稿

Peeetaro
Peeetaro

スコア17

test CHANGED
File without changes
test CHANGED
@@ -25,3 +25,127 @@
25
25
  ・destroy()
26
26
 
27
27
  上記2つの使用方法とどのような動きをするのかもわかる方がいればご教授願いたいです。
28
+
29
+
30
+
31
+ ```HTML
32
+
33
+ <div class="a">
34
+
35
+ <a class="b" href="">
36
+
37
+ <img class="rellax c" src="../public/images/landscape.jpg" alt="">
38
+
39
+ <div class="d">
40
+
41
+ <div class="e">
42
+
43
+ <h2 class="f">sample</h2><p class="g">text</p>
44
+
45
+ </div>
46
+
47
+ </div>
48
+
49
+ </a>
50
+
51
+ </div>
52
+
53
+ ```
54
+
55
+ ```CSS
56
+
57
+ .a {
58
+
59
+ position: relative;
60
+
61
+ height: 210px;
62
+
63
+ }
64
+
65
+
66
+
67
+ .b {
68
+
69
+ position: absolute;
70
+
71
+ display: block;
72
+
73
+ width: 100%;
74
+
75
+ height: 210px;
76
+
77
+ overflow: hidden;
78
+
79
+ }
80
+
81
+
82
+
83
+ .c {
84
+
85
+ width: 130%;
86
+
87
+ }
88
+
89
+
90
+
91
+ .d {
92
+
93
+ position: absolute;
94
+
95
+ bottom: 0;
96
+
97
+ width: 100%;
98
+
99
+ height: 50%;
100
+
101
+ background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
102
+
103
+ }
104
+
105
+
106
+
107
+ .e {
108
+
109
+ position: absolute;
110
+
111
+ bottom: 24px;
112
+
113
+ width: 100%;
114
+
115
+ padding: 0 24px;
116
+
117
+ color: #FFF;
118
+
119
+ text-align: center;
120
+
121
+ }
122
+
123
+
124
+
125
+ .f {
126
+
127
+ font-size: 20px;
128
+
129
+ }
130
+
131
+ ```
132
+
133
+ ```script
134
+
135
+ var rellax = new Rellax(' .rellax ',{
136
+
137
+ speed: .4,
138
+
139
+ center: false,
140
+
141
+ //wrapper: '.main',
142
+
143
+ round: true,
144
+
145
+ vertical: true,
146
+
147
+ horizontal: false
148
+
149
+ });
150
+
151
+ ```