当前位置:网站首页>Box avoiding mouse
Box avoiding mouse
2022-07-25 15:28:00 【꧁ small ۣۖ Pigeon ۣۖ Puzi ۣۖ ิ꧂】
Case principle : Put a picture in a big box and let it be located randomly , The rate of evasion is also random .
html, Just two contents, a big box , There is a picture in , Relative positioning of large boxes , Absolute positioning of the picture .
css Style gives the big box a width and height . Box style Namely border-radius: 100%, Color customization ;
Then let's look at the code

One . First, give the picture a random location , Get the width of the big box minus the width of the picture , It is the active range on the horizontal axis of the picture , Name it x, By analogy, the active range on the vertical axis of the picture is named y.
Two . Then determine an initial movement trend , The direction determined by random numbers .
Two . When the above two conditions are met, the animation effect will be executed , First call The film css
3、 ... and . The last key step is to give two criteria if you want the image to avoid colliding with the boundary , Just modify the parameters .

Finally, let's look at the picture

边栏推荐
- Recommend 10 learning websites that can be called artifact
- CF888G-巧妙字典树+暴力分治(异或最小生成树)
- IOS interview questions
- BPSK调制系统MATLAB仿真实现(1)
- UIDocumentInteractionController UIDocumentPickerViewController
- UIDocumentInteractionController UIDocumentPickerViewController
- Graph theory and concept
- JVM知识脑图分享
- Maxcompute SQL 的查询结果条数受限1W
- Flex 布局
猜你喜欢

Spark AQE

Example of password strength verification

Run redis on docker to start in the form of configuration file, and the connection client reports an error: server closed the connection

ML - 语音 - 高级语音模型

从 join on 和 where 执行顺序认识T-sql查询执行顺序

MATLAB 如何生产随机复序列

MATLAB读取显示图像时数据格式转换原因

BPSK调制系统MATLAB仿真实现(1)

为什么PrepareStatement性能更好更安全?

MySQL installation and configuration super detailed tutorial and simple database and table building method
随机推荐
Flex 布局
C#精挑整理知识要点9 集合2(建议收藏)
Xcode added mobileprovision certificate file error: Xcode encoded an error
ML - natural language processing - Basics
Xcode添加mobileprovision证书文件报错:Xcode encountered an error
Spark partition operators partitionby, coalesce, repartition
Singleton mode 3-- singleton mode
Promise object and macro task, micro task
NPM's nexus private server e401 E500 error handling record
ICPC2021昆明M-暴力+主席树
记一次Spark报错:Failed to allocate a page (67108864 bytes), try again.
2021上海市赛-H-二分答案
No tracked branch configured for branch xxx or the branch doesn‘t exist. To make your branch trac
redis淘汰策列
你准备好脱离“内卷化怪圈”了吗?
wait()和sleep()的区别理解
What is the Internet of things
MySQL heap table_ MySQL memory table heap Usage Summary - Ninth Five Year Plan small pang
matlab 如何保存所有运行后的数据
Implementation of asynchronous FIFO