摘要: 1. offset系列 offsetWidth = width + padding + border offsetHeight = height + padding + border offsetTop 和 offsetLeft: 检测盒子距离父系盒子中带有定位的盒子的距离。如果没有默认找距离bod 阅读全文
posted @ 2021-05-06 16:08 kathy2010 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 1、弹框展示的时候 ,修改 html,body{overflow:hidden} 弹框关闭的时候,修改 html,body{overflow:auto} 2. 弹框展示,滑动的时候,监听html的滚动事件 created() { let that = this; document.addEventL 阅读全文
posted @ 2021-05-06 14:48 kathy2010 阅读(274) 评论(0) 推荐(0) 编辑
摘要: var ua = navigator.userAgent.indexOf('iphone');//判断是否为ios if(ua >-1){ //ios下运行 var divEl = document.querySelector('.divEl')//你需要滑动的dom元素 iosTouchFn(di 阅读全文
posted @ 2021-05-06 14:38 kathy2010 阅读(2013) 评论(0) 推荐(1) 编辑
摘要: 1. 扩展运算符,用...表示,将一个数组转为用逗号分隔的参数序列 console.log(...[1, 2, 3]) // 1 2 3 console.log(1, ...[2, 3, 4], 5) // 1 2 3 4 5 [...document.querySelectorAll('div') 阅读全文
posted @ 2020-07-10 14:45 kathy2010 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1. a instanceof b //a是否是b类型 只能判断new出来的实例 2. Array.isArray(变量) // 判断变量是否是数组,h5新增 3. join(); 把数组转换成字符串; var arr = ["关羽","张飞","刘备"]; console.log(arr.join 阅读全文
posted @ 2020-07-06 17:51 kathy2010 阅读(174) 评论(0) 推荐(0) 编辑