-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
705 lines (316 loc) · 16.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">
<link rel="alternate" href="/default" title="Chelseasc">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.6.0" />
<link rel="canonical" href="http://sshencchen.me/"/>
<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.6.0" />
<link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" />
<script id="baidu_push">
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
<title> Chelseasc </title>
</head>
<body><div id="mobile-navbar" class="mobile-navbar">
<div class="mobile-header-logo">
<a href="/." class="logo">Chelseasc</a>
</div>
<div class="mobile-navbar-icon">
<span></span>
<span></span>
<span></span>
</div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
<ul class="mobile-menu-list">
<a href="/">
<li class="mobile-menu-item">
首页
</li>
</a>
<a href="/archives/">
<li class="mobile-menu-item">
归档
</li>
</a>
<a href="/about">
<li class="mobile-menu-item">
关于
</li>
</a>
</ul>
</nav>
<div class="container" id="mobile-panel">
<header id="header" class="header"><div class="logo-wrapper">
<a href="/." class="logo">Chelseasc</a>
</div>
<nav class="site-navbar">
<ul id="menu" class="menu">
<li class="menu-item">
<a class="menu-item-link" href="/">
首页
</a>
</li>
<li class="menu-item">
<a class="menu-item-link" href="/archives/">
归档
</a>
</li>
<li class="menu-item">
<a class="menu-item-link" href="/about">
关于
</a>
</li>
</ul>
</nav>
</header>
<main id="main" class="main">
<div class="content-wrapper">
<div id="content" class="content">
<section id="posts" class="posts">
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2018/05/21/倒计时返回/"></a>
</h1>
<div class="post-meta">
<span class="post-time">
2018-05-21
</span>
</div>
</header>
<div class="post-content">
<p>title: 倒计时返回<br>date: 2017-04-01 20:36:00</p>
<h2 id="categories-JS"><a href="#categories-JS" class="headerlink" title="categories: JS"></a>categories: JS</h2><p>模仿一下工行app里倒计时返回的效果,倒计时结束按钮才可用</p>
<p><img src="http://oyd0q85o6.bkt.clouddn.com/setInterval.gif" alt="image"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">//默认不可点击</span><br><span class="line"><div class="title"></span><br><span class="line"> <a href="http://baidu.com" onclick="return false;" class="modal-ok"></span><br><span class="line"> >返回<span id="set_time">(10s)</span></span><br><span class="line"> </a></span><br><span class="line"></div></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line"><script></span><br><span class="line"> /**</span><br><span class="line"> *计时器</span><br><span class="line"> */</span><br><span class="line"> var $set_time = $("#set_time");</span><br><span class="line"> var i = 10; //初始化倒计时秒数</span><br><span class="line"> var timer = setInterval(function () {</span><br><span class="line"> i--;</span><br><span class="line"> $set_time.text("(" + i + "s)");</span><br><span class="line"> if (i < 1) { //倒计时结束</span><br><span class="line"> $set_time.text("");</span><br><span class="line"> $set_time.parent(".modal-ok").css({ "background": "#0187d6", "color": "#fff", "border": "1px solid #0187d6" });</span><br><span class="line"> $set_time.parent(".modal-ok").removeAttr('onclick', 'return false;');</span><br><span class="line"> clearInterval(timer); //清楚计时器</span><br><span class="line"> }</span><br><span class="line"> }, 1000);</span><br><span class="line"></script></span><br></pre></td></tr></table></figure>
<p>setInterval()函数会不停的调用函数,直到执行clearInterval()为止才会终止。</p>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2018/03/05/两种方式给input输入的值转换为大写(或小写)/">两种方式给input输入的值转换为大写(或小写)</a>
</h1>
<div class="post-meta">
<span class="post-time">
2018-03-05
</span>
<div class="post-category">
<a href="/categories/vue/">vue</a>
</div>
</div>
</header>
<div class="post-content">
<p>1.事件</p>
<p>input里 加v-on:input=”handleFocus”</p>
<div class="read-more">
<a href="/2018/03/05/两种方式给input输入的值转换为大写(或小写)/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2018/03/03/scoped/">scoped属性及css作用域问题</a>
</h1>
<div class="post-meta">
<span class="post-time">
2018-03-03
</span>
<div class="post-category">
<a href="/categories/vue/">vue</a>
</div>
</div>
</header>
<div class="post-content">
<p>在Vue中,使用scoped后父组件的样式不会渗透到子组件中。</p>
<p>scoped虽然在某些情况下会降低css解析效率,但是它可以优雅的实现样式私有化,它通过使用PostCSS(github上的介绍:PostCSS is a tool for transforming CSS with JS plugins. These plugins can support variables and mixins, transpile future CSS syntax, inline images, and more.)来实现转换,效果如下:</p>
<div class="read-more">
<a href="/2018/03/03/scoped/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2018/03/01/属性覆盖/">JS对象的属性覆盖</a>
</h1>
<div class="post-meta">
<span class="post-time">
2018-03-01
</span>
<div class="post-category">
<a href="/categories/JS/">JS</a>
</div>
</div>
</header>
<div class="post-content">
<p> 在js中每个对象都有一个私有属性([[Prototype]]),并指向它的原型对象(prototype),这个原型对象也有自己的prototype,层层向上直到指向的原型为null。</p>
<p> 何为属性覆盖呢?先来看一组现象:<br>
<div class="read-more">
<a href="/2018/03/01/属性覆盖/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2018/01/23/element-ui Tree树形控件清空勾选项/">element-ui Tree树形控件清空勾选项</a>
</h1>
<div class="post-meta">
<span class="post-time">
2018-01-23
</span>
<div class="post-category">
<a href="/categories/vue/">vue</a>
</div>
</div>
</header>
<div class="post-content">
<p>现在有一个需求是清除Tree里已选项,简单的方法就是反选,再保存就好了。但是这样做很显然产品经理是不会同意的 (?⊙? ⊙?),下面的方式可以实现一键清除。</p>
<p><img src="http://oyd0q85o6.bkt.clouddn.com/element-tree.png" alt="image"><br>
<div class="read-more">
<a href="/2018/01/23/element-ui Tree树形控件清空勾选项/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2018/01/03/Maximum Continuous Subsequence Sum/">【数据结构与算法】最大子序列和</a>
</h1>
<div class="post-meta">
<span class="post-time">
2018-01-03
</span>
<div class="post-category">
<a href="/categories/数据结构/">数据结构</a>
</div>
</div>
</header>
<div class="post-content">
<p>最大子序列和</p>
<p>方法一:暴力 O(N3)</p>
<p>算出所有子列和,再求最大的</p>
<div class="read-more">
<a href="/2018/01/03/Maximum Continuous Subsequence Sum/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2017/10/23/vue数据添加单个删除批量删除/">vue.js之数据添加、单个删除和批量删除</a>
</h1>
<div class="post-meta">
<span class="post-time">
2017-10-23
</span>
<div class="post-category">
<a href="/categories/vue/">vue</a>
</div>
</div>
</header>
<div class="post-content">
<p>如图所示,我们要分别实现一个实际应用中非常常见的功能: 数据动态添加、重置、单个删除和整个删除,且删除之前出现提示框确认是否删除。(结合了<strong>bootstrap</strong>)</p>
<p><img src="http://oyd0q85o6.bkt.clouddn.com/vue02.gif" alt="vue02"></p>
<div class="read-more">
<a href="/2017/10/23/vue数据添加单个删除批量删除/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2016/09/12/奇技淫巧:中缀表达式&前缀后缀表达式/">奇技淫巧:中缀表达式&前缀后缀表达式</a>
</h1>
<div class="post-meta">
<span class="post-time">
2016-09-12
</span>
<div class="post-category">
<a href="/categories/数据结构/">数据结构</a>
</div>
</div>
</header>
<div class="post-content">
<p>不推荐 但可以提高考试效率的技巧:</p>
<p>问:写出a+b*c-d/e的前缀及后缀表达式</p>
<p>前缀解法:</p>
<ol>
<li>按照运算符的优先级对所有的运算单位加括号,于是得到 ( (a+ (b*c) ) - (d/e) )</li>
<li>把运算符移到对应括号前面,得到 -( +*(a (bc) ) /(de) )</li>
<li>去掉所有成对的括号,得到 - +*a bc /de 即前缀表达式</li>
</ol>
<p>后缀解法:</p>
<ol>
<li>按照运算符的优先级对所有的运算单位加括号,于是得到 ( (a+ (b*c) ) - (d/e) )</li>
<li>把运算符移到对应括号后面,得到 ( (a (bc) * ) + (de)/ )-</li>
<li>去掉所有成对的括号,得到 a bc *+ de/- 即后缀表达式</li>
</ol>
</div>
</article>
</section>
<nav class="pagination">
</nav>
</div>
</div>
</main>
<footer id="footer" class="footer">
<div class="social-links">
<a href="mailto:pandasscc@gmail.com" class="iconfont icon-email" title="email"></a>
<a href="https://github.com/Chelseasc" class="iconfont icon-github" title="github"></a>
<a href="/atom.xml" class="iconfont icon-rss" title="rss"></a>
</div>
<div class="copyright">
<span class="power-by">
由 <a class="hexo-link" href="https://hexo.io/">Hexo</a> 强力驱动
</span>
<span class="division">|</span>
<span class="theme-info">
主题 -
<a class="theme-link" href="https://github.com/ahonn/hexo-theme-even">Even</a>
</span>
<span class="copyright-year">
©
2016 -
2018
<span class="heart">
<i class="iconfont icon-heart"></i>
</span>
<span class="author">Chelseasc</span>
</span>
</div>
</footer>
<div class="back-to-top" id="back-to-top">
<i class="iconfont icon-up"></i>
</div>
</div>
<script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="/lib/slideout/slideout.js"></script>
<script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="/js/src/even.js?v=2.6.0"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=2.6.0"></script>
</body>
</html>