随笔分类 -  功能fun

一些可复用的公共功能方法
摘要:// 双击全屏 全屏状态双击取消 window.addEventListener('dblclick', () => { if (document.fullscreenElement) { document.exitFullscreen(); } else { documnet.querySelec 阅读全文
posted @ 2023-05-06 16:55 冰凝^ 阅读(10) 评论(0) 推荐(0) 编辑
摘要:web 浏览器页面实现滚屏效果 window 对象提供了执行动画的方法 window.requestAnimationFrame() 场景:固定位置显示多项内容列表 需要自动滚屏展示 demo: /** * 设置文本滚屏效果 */ setTextScroll(): void { const ulBo 阅读全文
posted @ 2023-04-10 15:42 冰凝^ 阅读(27) 评论(0) 推荐(0) 编辑
摘要:// new Date(2023, 5, 0).getDate();// 31const date = new Date();const length = new Date(date.getFullYear(), date.getMonth(), 0).getDate(); 阅读全文
posted @ 2023-04-06 16:48 冰凝^ 阅读(565) 评论(0) 推荐(0) 编辑
摘要:检查对象 Object 中是否含有某属性,可以用 in 验证,例如 const obj = { name: 'a', age: 3 }console.log('name' in obj); // trueconsole.log('sex' in obj); // false 阅读全文
posted @ 2023-03-21 17:05 冰凝^ 阅读(38) 评论(0) 推荐(0) 编辑
摘要:function(str: string): string { return str.slice(0,1).toUpperCase() + str.slice(1); } 阅读全文
posted @ 2023-03-20 17:06 冰凝^ 阅读(30) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示