当前位置:网站首页>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
边栏推荐
猜你喜欢

使用DialogFragment的一些感受及防踩坑经验(getActivity、getDialog为空,cancelable无效等)

OpenStack如何跨版本升级

关于云容灾,你需要知道这些

RecyclerView细节研究-RecyclerView点击错位问题的探讨与修复

Win10 comes with groove music, which can't play cue and ape files. It's a curvilinear way to save the country. It creates its own aimpack plug-in package, and aimp installs DSP plug-in

多云数据流转?云上容灾?年前最后的价值内容分享

Operation instructions of star boundary automatic text translator (advanced version)

剑指offer刷题(2)--面向华为

KVM学习资源

VMware installation 64 bit XP Chinese tutorial
随机推荐
Logback logger and root
rsync+inotify远程同步
翻牌效果
JDBC details
HyperMotion云迁移完成阿里云专有云产品生态集成认证
统信UOS卸载php7.2.24,安装php7.4.27 ;卸载再安装为PHP 7.2.34
星界边境Starbound创意工坊订阅的mod的存放路径
Preview CSV file
STD:: map and STD:: vector memory free
Date的after时间判断
星界边境文本自动翻译机使用说明
星界边境文本自动翻译机(高级版)使用说明
logback-logger和root
squid代理
GFS分布式文件系统(理论)
redis数据库讲解二(redis高可用、持久化、性能管理)
微信小程序客服接入,实现发送和接收消息
线程组ThreadGroup使用介绍+自定义线程工厂类实现ThreadFactory接口
网页自适应,等比缩放
关于NodeJS中JSON5的相关配置和使用