效果:

完整代码:
<!DOCTYPE html>
<html>
<head>
<title>鼠标跟随</title>
<meta charset="utf-8">
<style type="text/css">
body{
height: 5000px;
}
div{
position: absolute;
border: 1px solid #ccc;
cursor: pointer;
width: 100px;
height: 100px;
background-color: #03c03c;
opacity: 0.8;
animation:mymove 5s infinite;
/*Safari 和 Chrome:*/
-webkit-animation:mymove 5s infinite;
}
@keyframes mymove
{
0% {background-color:red;}
50% {background-color:yellow;}
100% {background-color:blue;}
}
/*Safari 和 Chrome:*/
@-webkit-keyframes mym

这篇博客展示了如何使用JavaScript结合CSS3实现鼠标点击元素后,其他元素跟随鼠标的动画效果。通过提供的完整代码,读者可以理解并应用到自己的项目中。
&spm=1001.2101.3001.5002&articleId=96127338&d=1&t=3&u=be10340a608c4a65ae9b9f4bde01f70d)
336

被折叠的 条评论
为什么被折叠?



