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

質問編集履歴

1

コードの訂正を行いました

2020/06/02 02:16

投稿

Rin0123
Rin0123

スコア2

title CHANGED
File without changes
body CHANGED
@@ -11,37 +11,48 @@
11
11
 
12
12
  ```HTML
13
13
  <body>
14
- <div class="mainBox-nav">
14
+ <div class="mainBox-nav">
15
15
  <nav id="mainNav">
16
16
  <ul id="nav-contents">
17
- <li class="nav-item">
18
- <a href="">
19
- <i class="fa fa-home" style="background-color: #5fb3f9;"></i>
17
+ <li class="nav-item" style="background-color: #5fb3f9;">
18
+ <a href="index.html">
19
+ <i class="fa fa-home"></i>
20
20
  </a>
21
21
  </li>
22
- <li class="nav-item">
22
+ <li class="nav-item" style="background-color: #60ead3;">
23
- <a href="">
23
+ <a href="#">
24
- <i class="fa fa-heartbeat" style="background-color: #60ead3;"></i>
24
+ <i class="fa fa-heartbeat"></i>
25
25
  </a>
26
26
  </li>
27
- <li class="nav-item">
27
+ <li class="nav-item" style="background-color: #fda660;">
28
- <a href="">
28
+ <a href="#">
29
- <i class="fa fa-codepen" style="background-color: #fda660;"></i>
29
+ <i class="fa fa-codepen" ></i>
30
30
  </a>
31
31
  </li>
32
- <li class="nav-item">
32
+ <li class="nav-item" style="background-color: #fd7b87;">
33
- <a href="">
33
+ <a href="#">
34
- <i class="fa fa-gear" style="background-color: #fd7b87;"></i>
34
+ <i class="fa fa-gear"></i>
35
35
  </a>
36
36
  </li>
37
37
  </ul>
38
38
  </nav>
39
+ <div id="header" class="animate hide">
40
+ <div id="h-inner" class="animate">
41
+ <h1>Page title</h1>
42
+ </div>
43
+ </div>
39
44
  </div>
40
45
  </body>
41
46
 
42
47
  ```
43
48
  ```css
44
49
  .mainBox-nav{
50
+ background-color: #f1f4f5;
51
+ font: 14px/28px 'Open Sans', sans-serif;
52
+ height: 650px;
53
+ width: 100%;
54
+ }
55
+ #header {
45
56
  position: relative;
46
57
  width: 100%;
47
58
  display: block;
@@ -49,10 +60,10 @@
49
60
  z-index: -1;
50
61
  height: 150px;
51
62
  }
52
- #h-inner{
63
+ #h-inner {
53
- width: 100%;
64
+ width: 100%;
54
65
  height: 100%;
55
- color: white;
66
+ color: #fff;
56
67
  line-height: 150px;
57
68
  font-size: 20px;
58
69
  }
@@ -71,12 +82,12 @@
71
82
  }
72
83
  .nav-item {
73
84
  width:150px;
74
- height:100px;
85
+ height:150px;
75
86
  background-color:orange;
76
87
  display:block;
77
88
  text-align:center;
78
89
  line-height:150px;
79
- cursor: auto;
90
+ cursor: pointer;
80
91
  }
81
92
  .nav-item a:hover i{
82
93
  -webkit-transition:all .4s ease-in-out;
@@ -91,10 +102,27 @@
91
102
  width:100%;
92
103
  height:100%;
93
104
  display:block;
105
+ text-decoration: none;
94
106
  }
95
107
  nav-item i{
96
108
  font-size:30px;
97
109
  }
110
+ .animate {
111
+ -webkit-transition: all .8s ease-in-out;
112
+ -moz-transition: all .8s ease-in-out;
113
+ -o-transition: all .8s ease-in-out;
114
+ transition: all .8s ease-in-out;
115
+ }
116
+
117
+ .cred {
118
+ color: #969696;
119
+ font-size: 7pt;
120
+ text-align: center;
121
+ margin-top: 20px;
122
+ text-decoration: none;
123
+ width: 100%;
124
+ display: block;
125
+ }
98
126
  ```
99
127
  ```js
100
128
  /*global $*/
@@ -105,18 +133,18 @@
105
133
  "use strict";
106
134
  $('.nav-item').click(function () {
107
135
  var navcol = $(this).css('backgroundColor');
108
- $('#mainNav').removeClass('show');
136
+ $('#header').removeClass('show');
109
- $('#mainNav').addClass('hide');
137
+ $('#header').addClass('hide');
110
138
 
111
139
  $(this).hide(800);
112
140
  $(this).addClass('active');
113
141
  setTimeout(function () {
114
142
 
115
143
  $('.active').prependTo('#nav-contents').show(800);
116
- $('nav-item').removeClass('active');
144
+ $('.nav-item').removeClass('active');
117
- $('#mainNav').removeClass('hide');
145
+ $('#header').removeClass('hide');
118
- $('#mainNav').addClass('show');
146
+ $('#header').addClass('show');
119
- $('#mainNav').css({
147
+ $('#header').css({
120
148
  "background-color": navcol
121
149
  });
122
150
  }, 800);