2022年10月21日

JavaScript中的bind使用技巧

摘要: function f() { return this.a; } //bind绑定会创一个与f具有相同函数体和作用域的新函数,在这个新函数中,this将会永久的绑定第一个参数。 var g = f.bind({ a: 'taotao' }); console.log(g()); //taotao va 阅读全文

posted @ 2022-10-21 16:02 totau 阅读(32) 评论(0) 推荐(0) 编辑

javascript 的setTimeOut 中this指向及外部参数传参

摘要: //外部的参数传参数,放到第三项及以后就可以 myArray = ['zero', 'one', 'two']; myArray.myMethod = function (sProperty) { console.log(arguments.length > 0 ? this[sProperty] 阅读全文

posted @ 2022-10-21 12:28 totau 阅读(102) 评论(0) 推荐(0) 编辑

2022年10月19日

JavaScript数组常用数组函数

摘要: const arr = [1,12,13,4,5,6,7,8]; //找出符合条件的第一个元素,并返回。 否返回undefined const fount = arr.find((x)=>{ return typeof(x) "number"; }) console.log('查找-find ', 阅读全文

posted @ 2022-10-19 13:33 totau 阅读(33) 评论(0) 推荐(0) 编辑

2022年10月14日

html+css 写出三角形状

摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文

posted @ 2022-10-14 15:38 totau 阅读(26) 评论(0) 推荐(0) 编辑

2022年10月6日

css 公共样式base.css

摘要: body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, input{ margin: 0; padding: 0; } *{ /* 内减模式 */ box-sizing: border-box; } body{ font: 16px/1.5 阅读全文

posted @ 2022-10-06 11:55 totau 阅读(168) 评论(0) 推荐(0) 编辑

2022年10月5日

css 图片居中显示

摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文

posted @ 2022-10-05 17:35 totau 阅读(91) 评论(0) 推荐(0) 编辑

2022年10月4日

css 定位

摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文

posted @ 2022-10-04 20:37 totau 阅读(12) 评论(0) 推荐(0) 编辑

2022年9月30日

定位

摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文

posted @ 2022-09-30 20:46 totau 阅读(15) 评论(0) 推荐(0) 编辑

2022年9月26日

css 外边距塌陷问题

摘要: 两个块级元素嵌套,如果里面的元素没有设置border 属性,在内层的 元素使用margin 时会把父元素节点 也会跟着移动, 故外边距塌陷问题, 解决方法 ,可以给父元素添加border ,或者给父元素 添加一个属性 overflow: hidden;的属性 <!DOCTYPE html> <htm 阅读全文

posted @ 2022-09-26 10:51 totau 阅读(46) 评论(0) 推荐(0) 编辑

css 清除浮动的方式

摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文

posted @ 2022-09-26 10:23 totau 阅读(21) 评论(0) 推荐(0) 编辑

导航