- Promise summary
- 异步操作, 装载着预定成功或失败时要执行的回调函数.
- 有三种状态: pending, fulfilled, rejected. 且状态不受外界影响;
- 状态变化有两种: pending->fulfilled, pending->rejected, 且状态改变后不会再变化.
- 无法取消 Promise;
- 不设置回调函数(成功的, 失败的), 不会反应到外部;
- pending 时, 无法得知进度.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <link | |
| rel="stylesheet" | |
| href="https://unpkg.com/swiper@7/swiper-bundle.min.css" | |
| /> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <!-- Link Swiper's CSS --> | |
| <link | |
| rel="stylesheet" | |
| href="https://unpkg.com/swiper/swiper-bundle.min.css" |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <!-- Link Swiper's CSS --> | |
| <link | |
| rel="stylesheet" | |
| href="https://unpkg.com/swiper/swiper-bundle.min.css" |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script> | |
| </head> | |
| <style> | |
| #demoCanvas { |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>point-in-semicircle</title> | |
| <script src="jquery-1.7.2.min.js"></script> | |
| <style> | |
| body{ | |
| border:0; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <script> | |
| function quadraticBzier(p, p0, p1, p2){ | |
| return Math.pow(1-p,2)*p0 +2*p*(1-p)*p1+Math.pow(p,2)*p2; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>world cup</title> | |
| <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
| <script src="http://underscorejs.org/underscore-min.js"></script> | |
| <style id="jsbin-css"> | |
| body{ | |
| font: 12px 微软雅黑,tahoma,arial; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>world cup</title> | |
| <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
| <script src="http://underscorejs.org/underscore-min.js"></script> | |
| <style id="jsbin-css"> | |
| body{ | |
| font: 12px 微软雅黑,tahoma,arial; |
| //中央球场列表 | |
| $('.football_bg').removeClass('football_bg').css({ | |
| width: '93px', | |
| height: '106px', | |
| position: 'absolute', | |
| left: '14px', | |
| top: '27px', | |
| 'font-size': '12px' | |
| }).show(); | |
| $('.football_bg2').removeClass('football_bg2').css({ |