当前位置:网站首页>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
边栏推荐
猜你喜欢
HyperMotion云迁移助力中国联通,青云完成某央企上云项目,加速该集团核心业务系统上云进程
RecyclerView高级使用(一)-侧滑删除的简单实现
Visio installation error 1:1935 2: {XXXXXXXX
使用Executors类快速创建线程池
redis数据库讲解二(redis高可用、持久化、性能管理)
利用json-server在本地创建服务器请求
01-nio basic ByteBuffer and filechannel
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
openstack理论知识
关于NodeJS中JSON5的相关配置和使用
随机推荐
Multiple inheritance virtual base exercises
ActiveMQ Basics
关于云容灾,你需要知道这些
JumpServer
线程间控制之Semaphore使用介绍
How to do a project easily
Quickly understand the three ways of thread implementation
Operation instructions of star boundary automatic text translator (advanced version)
线程间控制之CountDownLatch和CyclicBarrier使用介绍
MySQL数据库讲解(八)
操作系统常见面试题目:
STD:: map and STD:: vector memory free
man man随记和crontab的@reboot用法
線程組ThreadGroup使用介紹+自定義線程工廠類實現ThreadFactory接口
01-NIO基础之ByteBuffer和FileChannel
差分隐私(背景介绍)
On the multi-level certificate based on OpenSSL, the issuance and management of multi-level Ca, and two-way authentication
字节面试编程题:最小的K个数
云容灾是什么意思?云容灾和传统容灾的区别?
快速搞懂线程实现的三种方式