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

質問編集履歴

2

コードの追記

2019/06/20 07:17

投稿

Fiverainy
Fiverainy

スコア10

title CHANGED
File without changes
body CHANGED
@@ -5,15 +5,74 @@
5
5
  ### 該当のソースコード
6
6
 
7
7
  ```HTML
8
+ <!DOCTYPE HTML>
9
+ <html lang="ja">
10
+ <head>
11
+ <meta charset="utf-8" />
12
+ <!-- サイトのタイトル -->
13
+ <title>体験&スポット</title>
14
+ <!-- cssファイル -->
15
+ <link rel="stylesheet" href="giftbnbstyle.css" type="text/css"/>
16
+ <!-- jQuery本体 -->
17
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
18
+ <!-- jsファイル -->
19
+ <script type="text/javascript" src="giftbnb.js"></script>
20
+ <!-- viewport meta -->
21
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
22
+ <!-- ファビコン -->
23
+ <link rel="icon" href="img/bnbfavicon.ico">
24
+ <!-- bootstrap+jQuery+FontAwesome -->
25
+ <link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" />
26
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
27
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap-theme.min.css">
28
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
29
+
30
+ </head>
31
+ <body>
32
+ <div class="top">
8
- <div class="top-screen-container">
33
+ <div class="top-screen-container">
9
34
  <div class="top-screen-items">
10
35
  <div class="top-screen-item">
11
- <h1 class="text-light"><strong>さあ、はじめよう</strong></h1>
36
+ <h1 class="text-light"><strong>旅をしよう</strong></h1>
12
- <p class="text-light">Let's get started!</p>
37
+ <p class="text-light">世界をぐんと身近に</p>
13
- <a href="#"><button class="btn btn-light">登録</button></a>
14
38
  </div>
15
39
  </div>
16
40
  </div>
41
+ </div>
42
+
43
+ <section>
44
+
45
+
46
+ <div class="three-steps-container text-center">
47
+ <div class="three-steps row mx-auto">
48
+ <div class="big-midashi col-md-12 col-sm-12 col-xs-12 fadein">
49
+ <h1>贈りもの</h1>
50
+ </div>
51
+ <div class="midashi col-md-4 col-sm-12 col-xs-12 fadein">
52
+ <i class="far fa-envelope fa-3x cyan"></i>
53
+ <h1>簡単に使える</h1>
54
+ <p>登録は超かんたん。</p>
55
+ </div>
56
+ <div class="midashi col-md-4 col-sm-12 col-xs-12 fadein">
57
+ <i class="fas fa-stopwatch fa-3x cyan"></i>
58
+ <h1>有効期限なし</h1>
59
+ <p>旅をプランできます。</p>
60
+ </div>
61
+ <div class="midashi col-md-4 col-sm-12 col-xs-12 fadein">
62
+ <i class="fas fa-globe-asia fa-3x cyan"></i>
63
+ <h1>忘れられない旅</h1>
64
+ <p>ずっと憧れていた街の暮らしも叶います。</p>
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <!-- Optional JavaScript -->
70
+ <!-- jQuery first, then Popper.js, then Bootstrap JS -->
71
+ <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
72
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
73
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
74
+ </body>
75
+ </html>
17
76
  ```
18
77
 
19
78
  ```CSS
@@ -35,11 +94,35 @@
35
94
  display:table-cell;
36
95
  vertical-align:middle;
37
96
  }
97
+
98
+ /*fade系*/
99
+ .fadein {
100
+ opacity: 0;
101
+ transform : translate(0, 50px);
102
+ transition : all 1500ms;
103
+ }
104
+
105
+ .fadein.scrollin{
106
+ opacity: 1;
107
+ transform: translate(0, 0);
108
+ }
38
109
  ```
39
110
 
40
111
  ```jQuery
112
+
41
113
  $(function() {
114
+ $(window).scroll(function (){
115
+ $('.fadein').each(function(){
116
+ var elemPos = $(this).offset().top,
117
+ scroll = $(window).scrollTop(),
118
+ windowHeight = $(window).height();
119
+ if (scroll > elemPos - windowHeight + 80){
120
+ $(this).addClass('scrollin');
121
+ }
122
+ });
123
+ });
124
+
42
-  $('.top-screen-container').hide().fadeIn();
125
+ $('.top-screen-container').hide().fadeIn();
43
126
 
44
127
  });
45
128
  ```

1

クロームのコンソールに表示されたエラーメッセージの追記

2019/06/20 07:17

投稿

Fiverainy
Fiverainy

スコア10

title CHANGED
File without changes
body CHANGED
@@ -44,6 +44,20 @@
44
44
  });
45
45
  ```
46
46
 
47
+ ```error
48
+ jquery.min.js:2 jQuery.Deferred exception: $(...).hide(...).fadeIn is not a function TypeError: $(...).hide(...).fadeIn is not a function
49
+ at HTMLDocument.<anonymous> (http://127.0.0.1:5500/giftbnb.js:14:39)
50
+ at e (https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:29453)
51
+ at t (https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:29755) undefined
52
+ k.Deferred.exceptionHook @ jquery.min.js:2
53
+ jquery.min.js:2 Uncaught TypeError: $(...).hide(...).fadeIn is not a function
54
+ at HTMLDocument.<anonymous> (giftbnb.js:14)
55
+ at e (jquery.min.js:2)
56
+ at t (jquery.min.js:2)
57
+ bootstrap-theme.min.css:1 Failed to load resource: the server responded with a status of 403 ()
58
+ ```
59
+
60
+
47
61
  ### 試したこと
48
62
 
49
63
  CSS側でtransitionを設定していないか等、ネットで調べて出てきた解決方法はチェックしました。