当前位置:网站首页>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

边栏推荐
- How spark gets columns in dataframe --column, $, column, apply
- 图论及概念
- JVM-动态字节码技术详解
- C # fine sorting knowledge points 10 generic (recommended Collection)
- p4552-差分
- The development summary of the function of fast playback of audio and video in any format on the web page.
- Instance Tunnel 使用
- 记一次Spark报错:Failed to allocate a page (67108864 bytes), try again.
- ML - 自然语言处理 - 基础知识
- ML - 语音 - 语音处理介绍
猜你喜欢

MySql的安装配置超详细教程与简单的建库建表方法

Idea remotely submits spark tasks to the yarn cluster

Take you to create your first C program (recommended Collection)

Recommend 10 learning websites that can be called artifact

图论及概念

ML - 自然语言处理 - 自然语言处理简介

带你创建你的第一个C#程序(建议收藏)

ML - natural language processing - Introduction to natural language processing

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

Idea护眼色设置
随机推荐
记一次Yarn Required executor memeory is above the max threshold(8192MB) of this cluster!
数据系统分区设计 - 分区与二级索引
Qtime定义(手工废物利用简单好看)
CF888G-巧妙字典树+暴力分治(异或最小生成树)
matlab randint,Matlab的randint函数用法「建议收藏」
数据系统分区设计 - 请求路由
Object.prototype. Hasownproperty() and in
JVM dynamic bytecode technology details
CF750F1-思维dp
JVM garbage collector details
Graph theory and concept
Local cache --ehcache
CGO is realy Cool!
2021上海市赛-B-排序后dp
2021江苏省赛A. Array-线段树,维护值域,欧拉降幂
分布式原理 - 什么是分布式系统
解决vender-base.66c6fc1c0b393478adf7.js:6 TypeError: Cannot read property ‘validate‘ of undefined问题
Run redis on docker to start in the form of configuration file, and the connection client reports an error: server closed the connection
带你详细认识JS基础语法(建议收藏)
Spark获取DataFrame中列的方式--col,$,column,apply