JavaScript
No one is perfect
nobody can stop and nobody can
展开
-
函数防抖 数据节流
http://www.yangchuanqi.xyz/2020/03/23/数据节流/原创 2020-03-24 18:31:51 · 234 阅读 · 0 评论 -
reduce 的购物车遍历累加
money() { const money = this.cart.reduce((s, shop) => { if (shop.check == true) { s += shop.price * shop.count } ...原创 2019-12-20 19:49:01 · 530 阅读 · 0 评论 -
淘宝放大镜效果
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-U...原创 2019-11-14 20:47:37 · 145 阅读 · 0 评论 -
九九乘法表面向对象方法书写
<script> function CCC(n){ this.n=n } CCC.prototype.say=function(){ for(var i=1;i<=this.n;i++){ for(var j=1; j<=i;j++){ ...原创 2019-11-12 17:49:53 · 336 阅读 · 0 评论 -
面向对象的方式实现tab切换
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-...原创 2019-11-11 22:41:17 · 239 阅读 · 0 评论 -
获取非行间样式和行间样式方法
获取非行间样式因为存在兼容问题 有两种方式:非ie浏览器和IE8及以下非行间样式获取的是除css行内式以外的内嵌式和外联式内容 非IE获取方法// attr ==>要获取的元素// ele ==>要获取的元素的样式window.getComputedStyle(attr).eleIE8及以下获取方法(attr).currentStyle.ele使用if(getCo...原创 2019-11-11 09:22:14 · 308 阅读 · 0 评论 -
使用DOM和事件委派target 实现表格的动态添加和删除
html代码: <input type="text" id="age" placeholder="请输入年龄"> <input type="text" id="sex" placeholder="请输入性别"> <button id="btn">添加</button> <table> <...原创 2019-11-09 00:35:58 · 393 阅读 · 0 评论