08 2020 档案

摘要:1 let width = document.body.clientWidth //浏览器宽度 2 let height= document.body.clientHeight //浏览器高度 3 4 //电脑分辨率 5 let cHeight = screen.height 6 let cWidt 阅读全文
posted @ 2020-08-28 16:17 yw3692582 阅读(209) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 6 <!-- 引入样 阅读全文
posted @ 2020-08-16 14:20 yw3692582 阅读(377) 评论(0) 推荐(0) 编辑
摘要:1 <!-- 首先将jquery和layer.js放在index.html中 --> 2 <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script> 3 <script src="static/la 阅读全文
posted @ 2020-08-15 22:18 yw3692582 阅读(736) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <!-- jquery需要v1.8以上 --> 7 <script src="https://cdn.bootcdn.net/ajax/l 阅读全文
posted @ 2020-08-15 22:10 yw3692582 阅读(1276) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>监听浏览器的宽高变化</title> 5 </head> 6 <body style="width: 1440px;height: 1000px;"> 7 <div id="div"></div> 8 <scr 阅读全文
posted @ 2020-08-13 20:16 yw3692582 阅读(993) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 console.log(scre 阅读全文
posted @ 2020-08-12 22:21 yw3692582 阅读(524) 评论(0) 推荐(0) 编辑
摘要:1 let {keys, values, entries} = Object 2 let a = { 3 "b":'1', 4 "c":'2', 5 "d":'3' 6 } 7 for (let s of keys(a)) { 8 // b c d 9 console.log(s) 10 } 11 阅读全文
posted @ 2020-08-10 17:03 yw3692582 阅读(1842) 评论(0) 推荐(0) 编辑
摘要:1 // 扩展运算符(...) 2 let a = [1,2,3,4] 3 let b = [5,6,7,8] 4 let c = [9,10,11,12] 5 let d = '1'+'2'+'3' 6 // 将数组转为一个参数序列 7 console.log(...a) 8 // 将b添加在a的 阅读全文
posted @ 2020-08-10 16:49 yw3692582 阅读(2277) 评论(0) 推荐(0) 编辑
摘要:1 // 尾部调用 2 function f (x) { 3 console.log('这是函数f:'+ x) 4 return g(x) 5 } 6 function g (a) { 7 console.log('这是函数g:'+ a) 8 } 9 f(10) 10 // 尾递归:不会出现栈溢出现 阅读全文
posted @ 2020-08-10 16:11 yw3692582 阅读(291) 评论(0) 推荐(1) 编辑
摘要:1 // Math方法 2 // trunc:返回整数部分 3 console.log(Math.trunc(3.9)) 4 // sign:判断数值是正数、负数或者0 5 console.log(Math.sign(3.9)) 6 // fround:返回单精度浮点数 7 console.log( 阅读全文
posted @ 2020-08-10 15:54 yw3692582 阅读(181) 评论(0) 推荐(1) 编辑
摘要:let [a,b] = ['123','123.45'] console.log(Number.parseInt(a),Number.parseFloat(b)) 注:Number.parseInt和Number.parseFloat和原有的parseInt和parseFloat没有区别,只是将其移 阅读全文
posted @ 2020-08-10 15:48 yw3692582 阅读(190) 评论(0) 推荐(1) 编辑
摘要:1 let [a,b] = ['1'.padStart(3,'0'),'1'.padEnd(3,'0')] 2 //padStart和padEnd接受两个参数,第一个是总位数,第二个是所要填充的字符 3 console.log(a,b) //001 100 阅读全文
posted @ 2020-08-10 15:21 yw3692582 阅读(883) 评论(0) 推荐(1) 编辑
摘要:1 let map = new Map() 2 map.set('first','hellow') 3 map.set('second','world') 4 console.log(map) //Map(2) {"first" => "hellow", "second" => "world"} 5 阅读全文
posted @ 2020-08-10 15:11 yw3692582 阅读(1439) 评论(0) 推荐(1) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 </head> 7 <body> 8 <ul id="myUi"> 9 <li id="li1">去百度</li> 10 <li id=" 阅读全文
posted @ 2020-08-07 19:39 yw3692582 阅读(121) 评论(0) 推荐(1) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Screen Coordinates Example</title> 5 </head> 6 <body style="width: 1440px;height: 1000px;"> 7 <div id="di 阅读全文
posted @ 2020-08-07 19:12 yw3692582 阅读(768) 评论(0) 推荐(1) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 </head> 7 <body> 8 <button id="btn">双击1</button> 9 <button ondblclick 阅读全文
posted @ 2020-08-07 18:13 yw3692582 阅读(95) 评论(0) 推荐(1) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <style type="text/css"> 7 .box{ 8 width: 300px; 9 height: 300px; 10 } 阅读全文
posted @ 2020-08-07 16:33 yw3692582 阅读(72) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 </head> 7 <body> 8 <div> 9 <p id="p1">这是一个p标签</p> 10 <p>这是另外一个p标签</p> 阅读全文
posted @ 2020-08-07 16:11 yw3692582 阅读(1157) 评论(0) 推荐(0) 编辑
摘要:1 // 递归阶乘,arguments.callee指向一个正在执行的函数的指针 2 function fac(num) { 3 if (num <= 1) { 4 return 1 5 } else { 6 return num * arguments.callee(num - 1) 7 } 8 阅读全文
posted @ 2020-08-07 14:23 yw3692582 阅读(590) 评论(0) 推荐(0) 编辑
摘要:1 let a = 'abcd' //let a = ['a','b','c','d'] 亦可 2 console.log(a.includes('a')) //true 3 console.log(a.indexOf('a')) //0 4 includes:es6中新增加的方法,返回值为布尔值 阅读全文
posted @ 2020-08-07 13:43 yw3692582 阅读(305) 评论(0) 推荐(0) 编辑
摘要:1 let [a,b] = ['ca','CA'] 2 console.log(a.toUpperCase(),b.toLowerCase()) 阅读全文
posted @ 2020-08-07 13:14 yw3692582 阅读(406) 评论(0) 推荐(0) 编辑
摘要:1 function a(){ 2 console.log(arguments.length) 3 } 4 a(10) arguments是就是传递的参数,是以一个数组的形式来保存参数的 阅读全文
posted @ 2020-08-07 12:20 yw3692582 阅读(886) 评论(0) 推荐(0) 编辑
摘要:1 获取当前的时间戳:+new Date() 或 Date.now() 或 Date.parse(new Date()) 阅读全文
posted @ 2020-08-07 12:12 yw3692582 阅读(124) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示