日常bug
float-left
这个作者很懒,什么都没留下…
展开
-
一个简单的防抖
let timeout = -1 //写在外边 support(e) { this.sup = !this.sup clearTimeout(timeout) timeout = setTimeout(() => { console.log(this.sup) //这里边写需要防抖的内容 clearTimeout(timeout) }, 900) },原创 2020-11-12 14:07:59 · 274 阅读 · 0 评论 -
让input框只能写数字
<input type=“text” name="" οninput=“value=value.replace(/[^\d]/g,’’)”>原创 2019-10-21 17:11:47 · 129 阅读 · 0 评论 -
jQuery中offset方法
在js中获取元素实际宽度的方法是:div.offsetWidth; 获取元素距顶部的实际距离的方法是:div.offsetTop; jq当中 如果我要获取元素实际宽度 我不能这样写 $(".div").offsetWidth 这样写获取不到 我需要 $(".div").get(0).offsetWidth 或者 ...原创 2019-04-25 12:12:37 · 1729 阅读 · 0 评论 -
jQuery中ajax post方法
$.post(‘url路径’,{post要发送的数据},function(res){ console.log(res) 回调函数 })原创 2019-07-25 15:01:32 · 371 阅读 · 0 评论