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

質問編集履歴

2

誤字修正

2018/11/09 10:44

投稿

akihiro3
akihiro3

スコア955

title CHANGED
File without changes
body CHANGED
@@ -167,6 +167,7 @@
167
167
  } // slide
168
168
  ```
169
169
  **4.1つの関数にして配列にしてreturnする**
170
+ **5.`.done`を遅延してみる**
170
171
  結果・・・.doneの処理が一部されない
171
172
  ```jquery
172
173
  function current() {

1

誤字修正

2018/11/09 10:43

投稿

akihiro3
akihiro3

スコア955

title CHANGED
File without changes
body CHANGED
@@ -85,8 +85,8 @@
85
85
  function slide() {
86
86
  // 非同期処理
87
87
  $.when( // 先の順番の処理
88
- $('.nextSlide').animate({left: 0},1500), // -740: 完全に消えた時
88
+ $('.nextSlide').animate({left: 0},1500), // // 次をスライドイン
89
- $('.current').animate({left: - width},1500) // -740: 完全に消えた時
89
+ $('.current').animate({left: - width},1500) // スライドアウト
90
90
  ).done(function() { // whenが終わったら実行
91
91
  next();
92
92
  });
@@ -111,8 +111,8 @@
111
111
  結果・・・.doneの処理が一部されない
112
112
  ```jquery
113
113
  function current() {
114
- $('.nextSlide').animate({left: 0},1500); // -740: 完全に消えた時
114
+ $('.nextSlide').animate({left: 0},1500); // // 次をスライドイン
115
- $('.current').animate({left: - width},1500); // -740: 完全に消えた時
115
+ $('.current').animate({left: - width},1500); // スライドアウト
116
116
  }
117
117
 
118
118
  function slide() {
@@ -129,8 +129,8 @@
129
129
  ```jquery
130
130
  var current = function () {
131
131
  var d = $.Deferred();
132
- $('.nextSlide').animate({left: 0},1500); // -740: 完全に消えた時
132
+ $('.nextSlide').animate({left: 0},1500); // // 次をスライドイン
133
- $('.current').animate({left: - width},1500); // -740: 完全に消えた時
133
+ $('.current').animate({left: - width},1500); // スライドアウト
134
134
  return d.promise();
135
135
  };
136
136
 
@@ -147,11 +147,11 @@
147
147
  結果・・・動くのだが、そもそも1つの関数にしたいから他の方法を探す
148
148
  ```jquery
149
149
  function first() {
150
- return $('.nextSlide').animate({left: 0},1500); // -740: 完全に消えた時
150
+ return $('.nextSlide').animate({left: 0},1500); // // 次をスライドイン
151
151
  };
152
152
 
153
153
  function second() {
154
- return $('.current').animate({left: - width},1500); // -740: 完全に消えた時
154
+ return $('.current').animate({left: - width},1500); // スライドアウト
155
155
  };
156
156
 
157
157
  function slide() {
@@ -171,8 +171,8 @@
171
171
  ```jquery
172
172
  function current() {
173
173
  var obj = new Object();
174
- obj.val1 = $('.nextSlide').animate({left: 0},1500); // -740: 完全に消えた時
174
+ obj.val1 = $('.nextSlide').animate({left: 0},1500); // // 次をスライドイン
175
- obj.val2 = $('.current').animate({left: - width},1500); // -740: 完全に消えた時
175
+ obj.val2 = $('.current').animate({left: - width},1500); // スライドアウト
176
176
  return obj;
177
177
  };
178
178