質問編集履歴
2
divを修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -160,7 +160,7 @@
|
|
160
160
|
|
161
161
|
```html
|
162
162
|
|
163
|
-
<div class="historyBox box1955">
|
163
|
+
<div class="historyBox box1955"></div>
|
164
164
|
|
165
165
|
|
166
166
|
|
1
コードをつけました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,3 +21,157 @@
|
|
21
21
|
|
22
22
|
|
23
23
|
これはなぜでしょうか?
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
classesには、単なるブロックがついているだけです。
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
```js
|
34
|
+
|
35
|
+
// JavaScript Document
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
(function(){
|
40
|
+
|
41
|
+
var classes = document.getElementsByClassName('historyBox');
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
var wh = window.innerHeight;
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
function fadeIn(){
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
for (var i = 0; i < classes.length; i++) {
|
60
|
+
|
61
|
+
var thisBox = classes[i];
|
62
|
+
|
63
|
+
var thisDt = thisBox.children[1].children[0];
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
var thisSize = thisBox.getBoundingClientRect().top;
|
68
|
+
|
69
|
+
if(thisSize > 0 && thisSize <= wh/2){
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
thisDt.classList.add("fadein_new");
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
var furstDd = thisBox.children[1].children[1];
|
78
|
+
|
79
|
+
var secondDd = thisBox.children[1].children[2];
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
setTimeout
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
var timeDelay = function(){
|
90
|
+
|
91
|
+
furstDd.classList.add("fadein_new");
|
92
|
+
|
93
|
+
secondDd.classList.add("fadein_new");
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
setTimeout (timeDelay,400);
|
100
|
+
|
101
|
+
console.log(1);
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
//fadeIn();
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
window.onscroll = fadeIn;
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
function changeSize(){
|
132
|
+
|
133
|
+
var wh = window.innerHeight;
|
134
|
+
|
135
|
+
//console.log(ww + wh);
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
window.onresize = changeSize;
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
})();
|
156
|
+
|
157
|
+
```
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
```html
|
162
|
+
|
163
|
+
<div class="historyBox box1955">
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
```
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
すみません。仕事なのでできるところだけしかかけないことを謝ります。
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
一応動きは再現できて、その間にあれ?となったところをお聞きしているので、
|
176
|
+
|
177
|
+
多分法的には問題ないはずですが・・・。
|