会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
瑞瑞大人
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
13
下一页
2021年7月16日
gesture(解决ios双击放大)
摘要: iOS2.0中的手势事件:gesture事件 下面的事件只能在iOS中运行。在iOS中档两个手指操作的时候,就会产生手势,手势通常用于改变显示元素的大小,或者旋转显示的元素。手势事件分为三种:1.gesturestart:当一个手指已经按在屏幕上,另一个手指又触摸屏幕的时候触发。类似于touchst
阅读全文
posted @ 2021-07-16 11:36 瑞瑞大人
阅读(431)
评论(0)
推荐(0)
2021年7月12日
webpack2 的 tree shaking
摘要: tree shaking [ʃeɪk] v.摇;发抖;震动;动摇 n.抖动;摇动;颤动 即 webpack 在打包的过程中会将没用的代码进行清除(dead code)。 一般 dead code 具有一下的特征: 代码不会被执行,不可到达 代码执行的结果不会被用到 代码只会影响死变量(只写不读) 使
阅读全文
posted @ 2021-07-12 16:03 瑞瑞大人
阅读(103)
评论(0)
推荐(0)
2021年6月30日
设置固定高度渐变背景
摘要: background: linear-gradient(180deg, #ff5289 0%, #f7f7f8 100%), #f7f7f8; background-repeat: no-repeat; background-size: 100% 1.8rem; 高度为1.8rem的linear-g
阅读全文
posted @ 2021-06-30 17:46 瑞瑞大人
阅读(542)
评论(0)
推荐(0)
window.history.go(-1);后退不刷新问题 移动端
摘要: 在后退的界面上添加 判断是否是返回window.addEventListener('pageshow', function (e) { if(e.persisted || (window.performance && window.performance.navigation.type == 2))
阅读全文
posted @ 2021-06-30 11:19 瑞瑞大人
阅读(346)
评论(0)
推荐(0)
2021年6月29日
async 函数就是 Generator 函数的语法糖
摘要: generator和函数不同的是,generator由function*定义(注意多出的*号)除了return语句,还可以用yield返回多次 function* test() { let x = 1 yield x + 1; yield x + 2; return x + 3; } const g
阅读全文
posted @ 2021-06-29 17:44 瑞瑞大人
阅读(265)
评论(0)
推荐(0)
2021年6月28日
popstate和pageshow
摘要: 监听页面返回 popstate 当活动历史记录条目更改时,将触发popstate事件。如果被激活的历史记录条目是通过对history.pushState()的调用创建的,或者受到对history.replaceState()的调用的影响,popstate事件的state属性包含历史条目的状态对象的副
阅读全文
posted @ 2021-06-28 10:39 瑞瑞大人
阅读(555)
评论(0)
推荐(0)
2021年6月25日
动态 加载js,css文件
摘要: interface File { type: 'js'|'css'; url: string; } type libKey = 'mtstatSdk'|'elementUI'|'weChatJSSDK'; const libMap: Record<libKey, { files: File[]; l
阅读全文
posted @ 2021-06-25 10:55 瑞瑞大人
阅读(119)
评论(0)
推荐(0)
localStorage设置过期时间
摘要: export function getItemKeyList(): Array<string> { const keyList = []; for (let i = 0; i < localStorage.length; i += 1) { const key = localStorage.key(
阅读全文
posted @ 2021-06-25 10:52 瑞瑞大人
阅读(133)
评论(0)
推荐(0)
2021年6月21日
css省略号
摘要: 一行 overflow: hidden; white-space: nowrap; text-overflow: ellipsis; 多行 display: -webkit-box; overflow: hidden; text-overflow: ellipsis; word-break: bre
阅读全文
posted @ 2021-06-21 14:05 瑞瑞大人
阅读(104)
评论(0)
推荐(0)
2021年5月6日
js取消默认事件
摘要: w3c的方法是e.preventDefault(),IE则是使用e.returnValue = false; 或者使用return false 默认事件有 a链接的点击 表单提交
阅读全文
posted @ 2021-05-06 15:50 瑞瑞大人
阅读(202)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
13
下一页
公告