当前位置:网站首页>Web game engine
Web game engine
2022-07-04 17:15:00 【The fifth brother of the Wang family】
Web game engine - Partially Prepared Products
Sample code :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div style="width: 500px;height: 400px;border: solid 1px;">
<div id="kuaiBut" style="width:20px;height:20px;background-color:green;">
</div>
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var sunDun = 10;
setInterval(function() {
sunDun++;
console.log(sunDun);
moveFun('kuaiBut', 'left', 'top', sunDun);
if (sunDun >= 600) {
sunDun = 0;
}
}, 20)
})
/**
* @param {Object} x Axis
* @param {Object} y Axis
* @param {Object} lengt
*/
function moveFun(id, x, y, lengt) {
let pdWidth = $("#" + id).parent().width();
let pdheight = $("#" + id).parent().height();
console.log(pdWidth + ' - ' + pdheight);
if (y == '' || y == null || y == undefined) {
$("#" + id).css(x, lengt + 'px');
} else {
$("#" + id).css(x, lengt + 'px');
$("#" + id).css(y, lengt + 'px');
}
$("#" + id).css('position', 'absolute');
}
</script>
</html>
边栏推荐
- Solution du système de gestion de la chaîne d'approvisionnement du parc logistique intelligent
- S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
- 智慧物流园区供应链管理系统解决方案:数智化供应链赋能物流运输行业供应链新模式
- 被PMP考试“折磨”出来的考试心得,值得你一览
- 多年锤炼,迈向Kata 3.0 !走进开箱即用的安全容器体验之旅| 龙蜥技术
- PyTorch深度学习快速入门教程
- Maximum subarray and matrix multiplication
- 如何实现一个延时队列 ?
- 时序图数据建模与产业链分析
- 手里10万元存款买什么理财产品收益最高?
猜你喜欢

Visual studio 2019 (localdb) mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports 782

7 RSA密码体制

Solution of commercial supply chain coordination system in the mineral industry: build a digital intelligent supply chain platform to ensure the safe supply of mineral resources
Redis 的内存淘汰策略和过期删除策略的区别

昆明三环闭合工程将经过这些地方,有在你家附近的吗?

嵌入式软件架构设计-函数调用

Congratulations to Mr. Zhang Pengfei, chief data scientist of artefact, for winning the campaign Asia tech MVP 2022

Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection

Analysis of abnormal frequency of minor GC in container environment

Understand asp Net core - Authentication Based on jwtbearer
随机推荐
Unity interview questions (continuously updated)
C# 更加优质的操作MongoDB数据库
智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
Solution of commercial supply chain coordination system in the mineral industry: build a digital intelligent supply chain platform to ensure the safe supply of mineral resources
矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
Rebalance operation in spark and its difference from repartition operation
Hash table
How to implement a delay queue?
L1-072 scratch lottery
跳跃表实例
表单传递时,如何隐式将值传过去
Implement graph data construction task based on check point
C # realizes FFT forward and inverse transformation and frequency domain filtering
Is it safe for CITIC Securities to open an account online? Is the account opening fee charged
DataKit——真正的统一可观测性 Agent
安信证券网上开户安全吗 开户收费吗
Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection
PingCode 性能测试之负载测试实践
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
Integration of ongdb graph database and spark