上一页 1 2 3 4 5 6 7 ··· 18 下一页
摘要: 1、css一行文本超出... overflow: hidden; text-overflow:ellipsis; white-space: nowrap; 2、多行文本超出显示... display: -webkit-box; -webkit-box-orient: vertical; -webki 阅读全文
posted @ 2020-11-30 16:33 超哥20 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 一个月没有看鑫大的空间,今天一看,收益不少,先转一篇他说的图片加载失败占位符处理, 之前的处理: CSS代码: img { width: 128px; height: 96px; object-fit: cover; } img[src$="break.svg"] { object-fit: con 阅读全文
posted @ 2020-11-03 11:39 超哥20 阅读(679) 评论(0) 推荐(0) 编辑
摘要: 趁着空闲一两天,赶紧学习一下node,不然又要忘记了。今天完成了一个接口,自己用前端请求也是成功的,记录一下。 首先看一下整体的目录,最简单的了,后面再学习到内容肯定要再优化 其中,app.js是项目的入口,connect.js是统一用来连接数据库的方法,api文件下面的index.js用来存接口地 阅读全文
posted @ 2020-11-03 10:55 超哥20 阅读(1101) 评论(0) 推荐(0) 编辑
摘要: 1、防抖,触发高频事件后n秒内函数只会执行一次,如果n秒内高频事件再次出发,则重新计算时间。 const debounce = (fn, time) => { let timeout = null; return function() { clearTimeout(timeout) timeout 阅读全文
posted @ 2020-09-29 16:50 超哥20 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1、多重判断时使用Array.includes 例子: function test(fruit) { if (fruit == 'apple' || fruit == 'strawberry') { console.log('red'); } } 对比: function test(fruit) { 阅读全文
posted @ 2020-09-28 11:04 超哥20 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 刚好今天用到这个,就顺便记录一下 .noselect { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select 阅读全文
posted @ 2020-09-24 19:51 超哥20 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 可以使用svg处理,也可以使用伪元素处理,这里偷学了伪元素的处理方案 html: <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" 阅读全文
posted @ 2020-09-23 13:59 超哥20 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 首先,看了鑫大佬的文章后,百度了文章内容的两个方法: 1、CustomEvent事件是有程序创建的,可以有任意自定义功能的事件 2、dispatchEvent()方法给节点分派一个合成事件 这两个方法之前也见过,不过并没有去了解,这次刚好又看到,就简单了解一下。好了,直接进入正文 一、addEven 阅读全文
posted @ 2020-09-08 14:25 超哥20 阅读(2433) 评论(0) 推荐(0) 编辑
摘要: 1、使用Array.includes来处理多个条件 一般写法: function test(fruit) { if (fruit == 'apple' || fruit == 'strawberry') { console.log('red'); } } 使用Array.includes重写: fu 阅读全文
posted @ 2020-08-31 15:15 超哥20 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 1、javaScript检测横屏 window.addEventListener("resize", ()=>{ if(window.orientation 180|| window.orientation 0) { // 正常方向或屏幕旋转180度 console.log('竖屏'); }; if 阅读全文
posted @ 2020-08-05 10:43 超哥20 阅读(215) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 18 下一页