|
@@ -176,18 +176,55 @@ console.log($('.leftScWrap .sLC:visible')[0].swper)
|
176
|
176
|
|
177
|
177
|
|
178
|
178
|
// 点击增加竹子
|
|
179
|
+var ifAdd = false;
|
179
|
180
|
$('.addLeaf').click(function () {
|
180
|
|
- if ($('.loveCon .left .img .leafs').hasClass('cli')) {
|
181
|
|
-
|
|
181
|
+ if (ifAdd) {
|
|
182
|
+ alert('您已经捐过竹子了,感谢您的支持')
|
182
|
183
|
} else {
|
183
|
|
- $('.addLeaf').css('transform', 'scale(1.08)');
|
184
|
|
- $('.addLeaf').css('-webkit-transform', 'scale(1.08)');
|
185
|
|
- $('.loveCon .left .img .leafs').addClass('cli');
|
186
|
|
- setTimeout(function () {
|
187
|
|
- $('.loveCon .left .img .leafs').removeClass('cli');
|
188
|
|
- $('.addLeaf').css('transform', 'scale(1)');
|
189
|
|
- $('.addLeaf').css('-webkit-transform', 'scale(1)');
|
190
|
|
- }, 2000)
|
191
|
|
- }
|
|
184
|
+ if ($('.loveCon .left .img .leafs').hasClass('cli')) {
|
192
|
185
|
|
193
|
|
-})
|
|
186
|
+ } else {
|
|
187
|
+ $('.addLeaf').css('transform', 'scale(1.08)');
|
|
188
|
+ $('.addLeaf').css('-webkit-transform', 'scale(1.08)');
|
|
189
|
+ $('.loveCon .left .img .leafs').addClass('cli');
|
|
190
|
+ setTimeout(function () {
|
|
191
|
+ $('.loveCon .left .img .leafs').removeClass('cli');
|
|
192
|
+ $('.addLeaf').css('transform', 'scale(1)');
|
|
193
|
+ $('.addLeaf').css('-webkit-transform', 'scale(1)');
|
|
194
|
+ }, 2000)
|
|
195
|
+ $('.donateWrap').slideDown();
|
|
196
|
+ statusNum();
|
|
197
|
+ ifAdd = true;
|
|
198
|
+ }
|
|
199
|
+ }
|
|
200
|
+})
|
|
201
|
+$('.donateWrap .close').click(function () {
|
|
202
|
+ $('.donateWrap').slideUp();
|
|
203
|
+})
|
|
204
|
+$('.donateWrap').click(function () {
|
|
205
|
+ $('.donateWrap .close').click();
|
|
206
|
+})
|
|
207
|
+$('.donatePop').click(function (event) {
|
|
208
|
+ event.stopPropagation()
|
|
209
|
+})
|
|
210
|
+// 捐竹子数据变化
|
|
211
|
+
|
|
212
|
+function statusNum() {
|
|
213
|
+ var n = Number($('.donateWrap .num').html());
|
|
214
|
+ if (n != NaN) {
|
|
215
|
+ var t = 0;
|
|
216
|
+ var numTime = setInterval(function () {
|
|
217
|
+ t++;
|
|
218
|
+ $('.donateWrap .num').html(t)
|
|
219
|
+ if (t === n) {
|
|
220
|
+ window.clearTimeout(numTime);
|
|
221
|
+ t = 0;
|
|
222
|
+ }
|
|
223
|
+ if (t > 200) {
|
|
224
|
+ window.clearTimeout(numTime);
|
|
225
|
+ $('.donateWrap .num').html(n);
|
|
226
|
+ t = 0;
|
|
227
|
+ }
|
|
228
|
+ }, .01)
|
|
229
|
+ }
|
|
230
|
+}
|