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

win10自带Groove音乐不能播放CUE和APE文件的一种曲线救国办法,自己创建aimppack插件包,AIMP安装DSP插件

Research on recyclerview details - Discussion and repair of recyclerview click dislocation

MySQL-InnoDB-事务

01-nio basic ByteBuffer and filechannel

关于NodeJS中JSON5的相关配置和使用

HyperBDR云容灾V3.2.1版本发布|支持更多云平台,新增监控告警功能

MySQL数据库讲解(八)

OpenStack如何跨版本升级

困扰多年的系统调研问题有自动化采集工具了,还是开源免费的

A table splitting implementation scheme of MySQL and InnoDB, MyISAM and MRG_ Introduction to MyISAM and other engine application scenarios
随机推荐
Returns the subscript after array sorting
Arrays类的使用案例
openstack理论知识
Quickly understand the three ways of thread implementation
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
线程间控制之Semaphore使用介绍
A table splitting implementation scheme of MySQL and InnoDB, MyISAM and MRG_ Introduction to MyISAM and other engine application scenarios
什么是云迁移?云迁移的四种模式分别是?
SSH 通过跳板机连接远程主机
线程间控制之CountDownLatch和CyclicBarrier使用介绍
01-NIO基础之ByteBuffer和FileChannel
Multiple inheritance virtual base exercises
回顾2021:如何帮助客户扫清上云最后一公里的障碍?
多云数据流转?云上容灾?年前最后的价值内容分享
返回数组排序后下标
Some good articles on pthread multithreading
mysql锁数据库锁
mysql 5.1升级到5.68
OpenStack命令操作
grep无法重定向到文件的问题