当前位置:网站首页>JS parabola motion packaging method
JS parabola motion packaging method
2022-04-23 14:17:00 【Ruirui junior】
// Method of parabola animation
function jump(dom, dx, dy, time) {
//elx The position of the current element ,dx dy yes x ,y The offset
// let elX = $(dom).css("left").split('px')[0]*1;
// let elY = $(dom).css("top").split('px')[0]*1;
// parseInt($(".drawItem").eq(orginindex).position().left)
let elX = $(dom).attr("data-x") * 1;
let elY = $(dom).attr("data-y") * 1
let a = 0.003
let b = (dy - a * dx * dx) / dx
let timer = null;
// Start time of execution
var beginTime = new Date()
// End time
endTime = +beginTime + time
// Timer , Perform parabolic animation
timer = setInterval(() => {
let now = new Date()
let x, y;
if (now > endTime) {
// End of run
x = dx;
y =
版权声明
本文为[Ruirui junior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231408339147.html
边栏推荐
猜你喜欢
随机推荐
mysql 5.1升级到5.611
redis数据库讲解(三)redis数据类型
js 进度条,显示加载进度
修改Firebase Emulators的默认侦听IP
VMware 15pro mounts the hard disk of the real computer in the deepin system
ThreadGroup ThreadGroup implémente l'interface threadfactory en utilisant la classe Introduction + Custom thread Factory
MySQL数据库讲解(八)
进入新公司,运维工程师从下面这几项了解系统的部署
使用DialogFragment的一些感受及防踩坑经验(getActivity、getDialog为空,cancelable无效等)
星界边境文本自动翻译机使用说明
网页自适应,等比缩放
PySide2
星界边境Starbound创意工坊订阅的mod的存放路径
Get the thread return value. Introduction to the use of future interface and futuretask class
Arrays类的使用案例
教育行业云迁移最佳实践:海云捷迅使用HyperMotion云迁移产品为北京某大学实施渐进式迁移,成功率100%
win10自带Groove音乐不能播放CUE和APE文件的一种曲线救国办法,自己创建aimppack插件包,AIMP安装DSP插件
ansible及常用模块的使用
星界边境文本自动翻译机(高级版)使用说明
翻牌效果