tzmy
tzmy
emmmm,有没有一次全部引入
[demo](https://codepen.io/tzmy/pen/WqvmWX) ``` 1. 1 2. 2 3. 0.04 4. 0.04 ``` 产生这种bug的原因网上说是丢失精度,不过我觉得有可能是此方法是采用了其它的舍入方法,类似于四舍六入五留双的方法,当然也没有完全符合这些规则。 [参考](https://baike.baidu.com/item/%E6%95%B0%E5%80%BC%E4%BF%AE%E7%BA%A6%E8%A7%84%E5%88%99/1609642?fr=aladdin) ``` js Number.prototype.toFixed = function (num) { return myFixed(this.valueOf(),num); }; String.prototype.toFixed = function (num) { if(isNaN(this.valueOf())){ return...
[在线DEMO](https://codepen.io/tzmy/pen/wLrNMP) ```css body,html{ /* zxx: html标签无需参与,padding多余 */ margin: 0; padding: 0; } button{ background: none; border: 1px solid #ef7077; color:#ef7077; height: 30px; flex: 1; margin: 0.5rem; border-radius: 20px; } .button_box{...
[demo](https://codepen.io/tzmy/pen/XLppyW) ```js var div = document.createElement('div'); div.style.cssText='height:300px;width:150px;background:black;'; document.body.appendChild(div); div.style.cssText+='background:linear-gradient(to right bottom, red, blue);' ```
1.'styleSheets' 2. 3.nth-of-type 4.empty 5.3 6. 7.~ 8.not
[在线demo](https://codepen.io/tzmy/pen/XwyYvx) ```css .box{display: inline-block;width: 100px;height: 100px;margin: 10px;background-color: gray;} .box.active{background-color: skyblue;} .box:active{ opacity: 0.99;transition: opacity 0.35s; } ``` ```js for (var i = 0; i < 20; i++) { var box...
[在线demo](https://codepen.io/tzmy/pen/vwwrZx) ```css body,html{ margin: 0; padding: 0; height: 100%; } .container{ display: flex; flex-flow: column; justify-content: space-between; min-height: 100%; background: #2c94e9; } .content{ display: block; background: #dedede; } .footer{ display:...
[demo](https://codepen.io/tzmy/pen/YMLQVQ) ```html ``` ```css body { margin:0; padding:0; } li{ list-style:none; } .bg-color1{background: #424242;} .bg-color2{background: #8c8c8c;} .bg-color3{background: #d48b69;} .bg-color4{background: #fecb66;} .bg-color5{background: #c54941;} .bg-color6{background: #591c93;} .bg-color7{background: #e6e6e6;} .myDiv{ border:1px solid #999999;...
定时器被鄙视了 sad