質問編集履歴
2
質問への回答
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
bodyに.modal-openが付与された際に、全てのsectionに元々付与されている.hogeを削除し、
|
2
2
|
また.modal-openが消えたら.hogeを復活させる、ということをしたいです。
|
3
3
|
下記のように書いたのですが、動きませんでした。
|
4
|
+
モーダル表示につきましては、modaalを使用しています。
|
4
5
|
|
5
6
|
書き方をご存知の方がいらっしゃいましたら、ご教授いただけますと幸いです。
|
6
7
|
よろしくお願いいたします。
|
7
8
|
|
8
9
|
```html
|
9
|
-
<body
|
10
|
+
<body>//.siteをクリックでbodyに.modal-openを付与
|
11
|
+
<a class="site" data-toggle="modal" data-target="#Modal">オープン</a>
|
10
12
|
<section class="hoge"></section>
|
11
13
|
<section class="hoge"></section>
|
12
14
|
<section class="hoge"></section>
|
@@ -17,4 +19,7 @@
|
|
17
19
|
if($('.modal-open').length) {
|
18
20
|
$('section').removeClass('hoge');
|
19
21
|
}
|
20
|
-
```
|
22
|
+
```
|
23
|
+
|
24
|
+
### 追記
|
25
|
+
いただいた質問をもとに修正いたしました。具体的な内容が不足しており申し訳ありません。
|
1
記述ミス
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
bodyに.modal-openが付与された際に、sectionに元々付与されている.hogeを削除し、
|
1
|
+
bodyに.modal-openが付与された際に、全てのsectionに元々付与されている.hogeを削除し、
|
2
2
|
また.modal-openが消えたら.hogeを復活させる、ということをしたいです。
|
3
3
|
下記のように書いたのですが、動きませんでした。
|
4
4
|
|
@@ -8,6 +8,8 @@
|
|
8
8
|
```html
|
9
9
|
<body class="modal-open">
|
10
10
|
<section class="hoge"></section>
|
11
|
+
<section class="hoge"></section>
|
12
|
+
<section class="hoge"></section>
|
11
13
|
</body>
|
12
14
|
```
|
13
15
|
|