转圈圈动画animation
来源:互联网 发布:智业软件招聘 编辑:程序博客网 时间:2024/04/29 17:15
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<style>
*{
margin:0;
padding:0;
}
#circle{
background-color:coral;
height:100px;
width:100px;
position:relative;
}
</style>
<script>
window.onload = function () {
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<style>
*{
margin:0;
padding:0;
}
#circle{
background-color:coral;
height:100px;
width:100px;
position:relative;
}
</style>
<script>
window.onload = function () {
for (var i = 0; i < 20; i++) {
var Odiv = document.getElementById('circle');
// Odiv.onmouseover = function () {
var Odiv = document.getElementById('circle');
// Odiv.onmouseover = function () {
StartMove(window.screen.availWidth - 100, 'offsetLeft', 'left', function () {
StartMove(window.screen.availHeight - 170, 'offsetTop', 'top', function () {
StartMove(0, 'offsetLeft', 'left', function () {
StartMove(0, 'offsetTop', 'top')
})
})
});
}
StartMove(window.screen.availHeight - 170, 'offsetTop', 'top', function () {
StartMove(0, 'offsetLeft', 'left', function () {
StartMove(0, 'offsetTop', 'top')
})
})
});
}
}
// }
var timer = null;
function StartMove(itarget, key, direction, fn) {
clearInterval(timer);
var Odiv = document.getElementById('circle');
timer = setInterval(function () {
var speed = (itarget - Odiv[key]) / 5;
speed = speed > 0 ? Math.ceil(speed) : Math.floor(speed);
if (Odiv[key] == itarget) {
clearInterval(timer);
if (fn) {
fn();
}
}
else {
Odiv.style[direction] = Odiv[key] + speed + 'px';
}
}, 30)
}
</script>
</head>
<body>
<div id="circle"></div>
</body>
</html>
1 0
- 转圈圈动画animation
- iOS 转圈圈的动画
- 使用CAShapeLayer 的 转圈圈动画
- 转圈圈
- 类似 刷新的时候 那个转圈圈 动画
- 自定义Animation动画,完成跑圈动作
- Android ProgressDialog 转圈圈
- 【简单常用】转圈圈,
- 第八章 转圈圈
- X轴转圈动画
- 转圈圈定制加载中视图
- 关于AFNetworking菊花转圈圈的问题
- Swift ActivityIndicator 转圈圈的那个玩意
- 弧形转圈圈 带渐变色
- 进桌面卡、慢,网卡转圈圈
- js实现等待加载“转圈圈”效果
- Animation 动画
- Animation动画
- ubuntu_socket通信传送文件_g++编译
- TIANKENG’s restaurant
- Java设计模式(三—四)----工厂模式
- hive搭建指南
- C语言结构体
- 转圈圈动画animation
- 内联函数inline[matlab]
- BitmapFactory.Options详解
- android的Binder机制入门
- unbuntu搭建单机hadoop的注意事项
- 乌龟棋
- 计算后缀数组的LCP(Longest Common Prefix)
- Activity隐藏标题栏
- 判断apk是否运行在调试状态的方法Debug. isDebuggerConnected之原理