![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
封装函数
态度0527
这个作者很懒,什么都没留下…
展开
-
js倒计时函数封装
function countDown(time) { var now_Time = +new Date(); var inputTime = +new Date(time);//返回的是用户输入时间的总毫秒数 console.log(now_Time); console.log(inputTime); var countdown = (inputTime - now_Time) / 100原创 2021-04-29 23:23:17 · 217 阅读 · 0 评论 -
js自写封装缓动动画函数
翻看以前学习内容发现与拿来封装了好多函数 记录一下 f//缓动动画公式(目标值-现在位置)/10 function animation(obj, target,callback) { clearInterval(obj.timer); obj.timer = setInterval(function () { // var step_size=Math.ceil((target-obj.offsetLeft)/10);考虑回来负值的原因 //步长值要写在定时器原创 2021-04-29 23:18:40 · 140 阅读 · 0 评论