分享js动画案例(初学了解)

可直接复制代码运行查看效果

 

<!DOCTYPE html>
<html>

<head> 
	<meta charset="utf-8">
	<title>基础动画了解</title>
</head>
<body style="background-color: #000;position: relative;">
	<div class="contain">
		<div class="ball" id="ball"></div>
		<div class="pplayout" id="contain"></div>
	</div>
	<style type="text/css">
		.point{width:1px;height: 1px;border-radius: 50%;overflow: hidden;background:#000;left: 0;top:0;position: absolute;}
		.contain{background-color: #eee;width: 500px;height: 300px;position: relative;display: block;margin:0 auto;margin-top: 10%;}
		.pplayout{width: 100%;height: 100%;position: relative;display: block;z-index: 5;}
		.ball{width:10px;height: 10px;border-radius: 50%;overflow: hidden;box-shadow: 0 0 3px red;background-image: linear-gradient(-90deg, red, yellow);left: -5px;top:295px;position: absolute;z-index: 10;}
		button{
			margin: 5px 0 0 5px;
		}
	</style>
	<div style="margin: 0 auto;width: 500px;">
		<button onclick="runAni('Linear')">Linear</button>
		<button onclick="runAni('Quad.easeIn')">Quad.easeIn</button>
		<button onclick="runAni('Quad.easeOut')">Quad.easeOut</button>
		<button onclick="runAni('Quad.easeInOut')">Quad.easeInOut</button>

		<button onclick="runAni('Cubic.easeIn')">Cubic.easeIn</button>
		<button onclick="runAni('Cubic.easeOut')">Cubic.easeOut</button>
		<button onclick="runAni('Cubic.easeInOut')">Cubic.easeInOut</button>

		<button onclick="runAni('Quart.easeIn')">Quart.easeIn</button>
		<button onclick="runAni('Quart.easeOut')">Quart.easeOut</button>
		<button onclick="runAni('Quart.easeInOut')">Quart.easeInOut</button>

		<button onclick="runAni('Sine.easeIn')">Sine.easeIn</button>
		<button onclick="runAni('Sine.easeOut')">Sine.easeOut</button>
		<button onclick="runAni('Sine.easeInOut')">Sine.easeInOut</button>

		<button onclick="runAni('Expo.easeIn')">Expo.easeIn</button>
		<button onclick="runAni('Expo.easeOut')">Expo.easeOut</button>
		<button onclick="runAni('Expo.easeInOut')">Expo.easeInOut</button>

		
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值