質問編集履歴
1
コードのインデント整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
はじめまして。
|
1
|
+
はじめまして。
|
2
2
|
|
3
3
|
現在ウェブサイトを作成しており、jsがうまくいきません。
|
4
4
|
|
@@ -50,9 +50,9 @@
|
|
50
50
|
|
51
51
|
if(w > n){ //タブレットより大きいデバイス
|
52
52
|
|
53
|
+
|
54
|
+
|
53
55
|
console.log("Lclear");
|
54
|
-
|
55
|
-
|
56
56
|
|
57
57
|
// セクションごとにメニューのスタイルを変える
|
58
58
|
|
@@ -60,49 +60,47 @@
|
|
60
60
|
|
61
61
|
$(window).scroll(function(){
|
62
62
|
|
63
|
+
// ABOUT-PRODUCT間
|
63
64
|
|
65
|
+
if ($(window).scrollTop() > $('#about').offset().top && $(window).scrollTop() < $('#contact').offset().top){
|
64
66
|
|
65
|
-
|
67
|
+
console.log("about-productClear");
|
66
68
|
|
67
|
-
|
69
|
+
// クラス追加 (文字色(黒)、padding変更)
|
68
70
|
|
69
|
-
|
71
|
+
$("header").addClass("is-animation");
|
70
72
|
|
71
|
-
// クラス追加 (文字色(黒)、padding変更)
|
72
|
-
|
73
|
-
$("header").addClass("is-animation");
|
74
|
-
|
75
|
-
$("header").removeClass("contact-animation");
|
73
|
+
$("header").removeClass("contact-animation");
|
76
74
|
|
77
75
|
|
78
76
|
|
79
|
-
//CONTACTセクション
|
77
|
+
//CONTACTセクション
|
80
78
|
|
81
|
-
}else if ($(window).scrollTop() > $("#product").offset().top){
|
79
|
+
}else if ($(window).scrollTop() > $("#product").offset().top){
|
82
80
|
|
83
|
-
|
81
|
+
// クラス追加 (文字色(白)、padding変更)
|
84
82
|
|
85
|
-
$("header").removeClass("is-animation");
|
83
|
+
$("header").removeClass("is-animation");
|
86
84
|
|
87
|
-
$("header").addClass("contact-animation");
|
85
|
+
$("header").addClass("contact-animation");
|
88
86
|
|
89
87
|
|
90
88
|
|
91
89
|
// それ以外のセクション(TOP)
|
92
90
|
|
93
|
-
}else{
|
91
|
+
}else{
|
94
92
|
|
95
|
-
$("header").removeClass("is-animation");
|
93
|
+
$("header").removeClass("is-animation");
|
96
94
|
|
97
|
-
$("header").removeClass("contact-animation");
|
95
|
+
$("header").removeClass("contact-animation");
|
98
96
|
|
99
|
-
};
|
97
|
+
};
|
98
|
+
|
99
|
+
});
|
100
100
|
|
101
101
|
});
|
102
102
|
|
103
|
-
});
|
104
|
-
|
105
|
-
};
|
103
|
+
};
|
106
104
|
|
107
105
|
});
|
108
106
|
|
@@ -117,8 +115,6 @@
|
|
117
115
|
if(w > n){ //タブレットより大きいデバイス
|
118
116
|
|
119
117
|
console.log('Lresizeclear');
|
120
|
-
|
121
|
-
|
122
118
|
|
123
119
|
$('.nav').css('display','block');
|
124
120
|
|
@@ -136,17 +132,17 @@
|
|
136
132
|
|
137
133
|
console.log("Rabout-productClear");
|
138
134
|
|
139
|
-
$("header").addClass("is-animation");
|
135
|
+
$("header").addClass("is-animation");
|
140
136
|
|
141
137
|
|
142
138
|
|
143
|
-
// それ以外のセクション
|
139
|
+
// それ以外のセクション
|
144
140
|
|
145
141
|
}else{
|
146
142
|
|
147
|
-
$("header").removeClass("is-animation");
|
143
|
+
$("header").removeClass("is-animation");
|
148
144
|
|
149
|
-
};
|
145
|
+
};
|
150
146
|
|
151
147
|
});
|
152
148
|
|
@@ -156,15 +152,15 @@
|
|
156
152
|
|
157
153
|
}else { //タブレットより小さい
|
158
154
|
|
159
|
-
console.log('Sresizeclear');
|
155
|
+
console.log('Sresizeclear');
|
160
156
|
|
161
|
-
$('.nav').css('display','none');
|
157
|
+
$('.nav').css('display','none');
|
162
158
|
|
163
|
-
$("header").removeClass("is-animation");
|
159
|
+
$("header").removeClass("is-animation");
|
164
160
|
|
165
|
-
};
|
161
|
+
};
|
166
162
|
|
167
|
-
});
|
163
|
+
});
|
168
164
|
|
169
165
|
});
|
170
166
|
|