摘要: 最开始接触的遍历for 通过下标获取数组每一项的值 forEach遍历数组 不能直接中止循环(break,return) for..in遍历对象和数组 由于可以遍历出所有的可枚举属性,所以在数组上不建议使用 遍历对象 for..of 可以中止循环,同时又避开了for-in 的缺点(遍历所有可枚举属性 阅读全文
posted @ 2018-08-29 14:50 yewook 阅读(897) 评论(0) 推荐(0) 编辑
摘要: 函数提升在变量提升之上 js引擎在解析js代码的步骤:一是解释,二是执行 解释就是先通篇扫描所有的js代码,然后把所有声明提到顶端,第二则是执行 变量提升 直接打印 console.log(foo) /*报错*/ 函数提升 变量提升只会提升函数名,而函数提升则会提升整个函数 阅读全文
posted @ 2018-08-28 15:31 yewook 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 很简单的一个音乐播放器 data:{ src: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384 阅读全文
posted @ 2018-06-14 14:08 yewook 阅读(3158) 评论(0) 推荐(0) 编辑
摘要: flex-direction: row; 显示: flex-direction: column; 显示: flex-direction: row-reverse; 显示 flex-direction: column-reverse; 显示 flex-wrap: nowrap | wrap | wra 阅读全文
posted @ 2018-03-04 20:08 yewook 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 1.一列布局 html: css: 2.两列布局(指定宽度) html: css: 3.双飞翼布局(中间自适应,左右列固定宽度) html: css: 4.多栏布局 栅格系统,是bootstrap常用的布局模式,下列就举个简单四栏例子 html: css: 常见还有column-count、colu 阅读全文
posted @ 2018-02-21 14:33 yewook 阅读(149) 评论(0) 推荐(0) 编辑
摘要: ...是es6中新添加的操作符,可以称为spread或rest 定义一个数组 let name=['小红','小明','小白']; 我们在控制台输出 console.log(name); 结果: 在输出的时候加上三个点 console.log(...name); 结果:数组被展开 再创建一个数组 l 阅读全文
posted @ 2018-02-13 21:37 yewook 阅读(223) 评论(0) 推荐(0) 编辑
摘要: div的height:100%有作用 其父元素设置height:100% 包括html,body 阅读全文
posted @ 2018-01-12 17:42 yewook 阅读(84) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><style> .box{ margin:100px; width:200px; height:100px; back 阅读全文
posted @ 2018-01-09 19:35 yewook 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1、transform实现居中(未设宽高) 2、margin:auto(固定宽高) 3、绝对定位(固定宽高) 4、table-cell和vertical-align(固定宽高),但是这种方法会使父元素无法居中 阅读全文
posted @ 2018-01-08 18:55 yewook 阅读(141) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="utf-8"><head> <meta charset="UTF-8"> <title>h5页面</title></head><body> <header> <h1>网站名称</h1> <nav> <ul> <li></li> <li></li> 阅读全文
posted @ 2018-01-08 16:36 yewook 阅读(125) 评论(0) 推荐(0) 编辑