adong搬砖

导航

随笔分类 -  前端

dom操作
摘要:节点类型 元素类型 元素节点 属性节点 文本节点 注释节点 nodeName 大写标签名 属性名 #test #comment nodeType 1 2 3 8 nodeValue null 属性值 文本内容 注释内容 获取节点 <body> <ul> <!-- 注释 --> <li>1</li> 阅读全文

posted @ 2026-02-04 20:39 adong搬砖 阅读(6) 评论(0) 推荐(0)

flex+margin(列表布局)
摘要:.item { --n: 8; background-color: red; width: 50px; height: 50px; margin: 10px calc((100% - var(--n)*50px)/var(--n)/2); } #container { width: 600px; h 阅读全文

posted @ 2024-09-02 14:48 adong搬砖 阅读(26) 评论(0) 推荐(0)

nginx 反向代理
摘要:nginx.conf http { server { listen 80; server_name localhost; location ^~ /api { root html; index index.html; proxy_pass http://localhost:5000/api;#前面加 阅读全文

posted @ 2024-08-12 15:01 adong搬砖 阅读(25) 评论(0) 推荐(0)

表情大全
摘要:🐊 😭 😂 😄 😍 😛 🤔 🤐 😴 🤧 🤠 😎 😞 😠 💩 😸 🙈 ❤ 💋 😄 😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 🫠 阅读全文

posted @ 2024-03-03 16:51 adong搬砖 阅读(63) 评论(0) 推荐(0)

随机数(整数)
摘要:function getintrandom(a,b){ return Math.floor(Math.random()*(Math.abs(b-a)+1)+Math.min(a,b))//包头包尾 } 阅读全文

posted @ 2023-11-26 01:40 adong搬砖 阅读(19) 评论(0) 推荐(0)

九九乘法表
摘要:document.write('<table style="border-spacing:12px">') for (var j = 1; j <= 9; j++) { document.write('<tr align="left">') for (var i = 1; i <= j; i++) 阅读全文

posted @ 2023-11-26 01:29 adong搬砖 阅读(20) 评论(0) 推荐(0)

防抖节流
摘要://****************节流********************** //节流代码 function throttle(f) { let timer return function () { if (timer) return timer = setTimeout(() => { f 阅读全文

posted @ 2023-11-26 01:22 adong搬砖 阅读(21) 评论(0) 推荐(0)

滚动条不显示
摘要:/*滚动条不显示(连接选择器的时候没有空格)*/ ::-webkit-scrollbar{display:none} 阅读全文

posted @ 2023-11-26 00:04 adong搬砖 阅读(20) 评论(0) 推荐(0)

一行溢出和两行溢出
摘要:/*一行溢出*/.box1{ width:100px; white-space:nowrap; overflow: hidden; text-overflow: ellipsis; } /*两行溢出(有时候不起作用,给固定高度)*/ .box2{ overflow: hidden; text-ove 阅读全文

posted @ 2023-11-25 23:17 adong搬砖 阅读(25) 评论(0) 推荐(0)