ducky_L

导航

2023年4月24日 #

js 实现继承

摘要: 一、使用原型链 function Animal1(leg){ this.leg=leg; } function Dog1(name){ this.name=name; Animal1.call(this,4) //!!import1 } Dog1.prototype.__proto__=Animal 阅读全文

posted @ 2023-04-24 17:59 ducky_L 阅读(2) 评论(0) 推荐(0) 编辑

js 如何实现类

摘要: 一、使用原型 function Chicken1(name) { this.name = name } Chicken1.prototype.kind = 'chicken'; Chicken1.prototype.say = function () { console.log(`hello,i'm 阅读全文

posted @ 2023-04-24 17:44 ducky_L 阅读(23) 评论(0) 推荐(0) 编辑

css 渲染优化的方式

摘要: 1、加载性能优化:css压缩、css单一样式、减少使用 @import, 而建议使用link; 2、 选择器性能优化: 避免使用通配规则 * 尽量少的去对标签进行选择,而是用class 不要去用标签限定ID或者类选择符:ul#nav,应该简化为#nav 尽量少的去使用后代选择器,降低选择器的权重值 阅读全文

posted @ 2023-04-24 11:40 ducky_L 阅读(31) 评论(0) 推荐(0) 编辑

css 移动端1px问题及解决

摘要: 1、问题原因:移动设备推出一个设备像素?:dpr=window.devicePixelRatio,也就是设备的物理像素与逻辑像素的?值。在retina屏的?机上, dpr为2或3,css?写的1px宽度映射到物理像素上就有2px或3px宽度。 2、解决方法:border-image实现、backgr 阅读全文

posted @ 2023-04-24 10:25 ducky_L 阅读(64) 评论(0) 推荐(0) 编辑