当前位置:网站首页>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
边栏推荐
猜你喜欢
字节面试编程题:最小的K个数
正则表达式
HyperMotion云迁移完成阿里云专有云产品生态集成认证
Installation and use of postman pit
MySQL数据库讲解(七)
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
KVM学习资源
OpenStack如何跨版本升级
多云数据流转?云上容灾?年前最后的价值内容分享
剑指offer刷题(2)--面向华为
随机推荐
On the multi-level certificate based on OpenSSL, the issuance and management of multi-level Ca, and two-way authentication
sar命令详解
什么是云迁移?云迁移的四种模式分别是?
dp-能量项链
错误:无法远程查找到密钥 “428F7ECC7117F726“
std::map 和 std::vector 内存释放
pthread_ Why does self() repeat
MySQL数据库讲解(八)
Some good articles on pthread multithreading
mysql 5.1升级到5.67
一些小小小小记录~
void*是怎样的存在?
HyperMotion云迁移助力中国联通,青云完成某央企上云项目,加速该集团核心业务系统上云进程
Storage path of mod subscribed by starbound Creative Workshop at Star boundary
On September 8, the night before going to Songshan Lake
HyperBDR云容灾V3.3.0版本发布|容灾功能升级,资源组管理功能优化
Quickly understand the three ways of thread implementation
Introduction to loan market quotation interest rate (LPR) and loan benchmark interest rate
Operation instructions of star boundary text automatic translator
MySQL基础知识