質問するログイン新規登録

質問編集履歴

1

インデントを追加しました。

2017/06/28 15:10

投稿

no23h
no23h

スコア49

title CHANGED
File without changes
body CHANGED
@@ -8,42 +8,36 @@
8
8
  ```
9
9
  <script>
10
10
  $(function(){
11
- $(".conent_hide").hide();
11
+ $(".conent_hide").hide();
12
- $(".re").click(function(){
12
+ $(".re").click(function(){
13
- x=$(".re").text();
13
+ x=$(".re").text();
14
-
15
- $(".conent_hide").slideToggle( function(){
14
+ $(".conent_hide").slideToggle( function(){
16
-
17
- if(x == "続きを読む"){
15
+ if(x == "続きを読む"){
18
- $(".re").text("続きを読む").css({color:"red"});
16
+ $(".re").text("続きを読む").css({color:"red"});
19
- }
17
+ }
20
- else{
18
+ else{
21
- $(".re").text("閉じる").css({color:"green"});
19
+ $(".re").text("閉じる").css({color:"green"});
22
- }
20
+ }
21
+ });
22
+ });
23
23
  });
24
- });
25
- });
26
24
  </script>
27
25
 
28
26
 
29
27
  <dl>
30
- <dt>AAA</dt>
28
+ <dt>AAA</dt>
31
- <dd>
29
+ <dd>
32
- <p>AAAのテキスト
33
- <div class="conent_hide">AAAのreadmoreテキスト</div>
30
+ <p>AAAのテキスト<div class="conent_hide">AAAのreadmoreテキスト</div></p>
34
- </p>
35
- <span class="re">続きを読む</span>
31
+ <span class="re">続きを読む</span>
36
- </dd>
32
+ </dd>
37
33
  </dl>
38
34
 
39
35
  <dl>
40
- <dt>BBB</dt>
36
+ <dt>BBB</dt>
41
- <dd>
37
+ <dd>
42
- <p>BBBのテキスト
43
- <div class="conent_hide">BBBのreadmoreテキスト</div>
38
+ <p>BBBのテキスト<div class="conent_hide">BBBのreadmoreテキスト</div></p>
44
- </p>
45
- <span class="re">続きを読む</span>
39
+ <span class="re">続きを読む</span>
46
- </dd>
40
+ </dd>
47
41
  </dl>
48
42
 
49
43
  ```