JQ自定义动画
2016-10-29 10:11
183 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>自定义动画</title>
<style type="text/css">
#one{
width: 300px;
height: 300px;
background-color: red;
color: #fff;
font-size: 50px;
line-height: 300px;
margin: 20px auto;
text-align: center;
}
</style>
</head>
<body>
<div id="one">动画</div>
<input type="button" name="" id="custom" value="自定义动画" />
<input type="button" name="" id="custom2" value="自定义动画2" />
<input type="button" name="" id="custom3" value="自定义动画3" />
<input type="button" name="" id="stop" value="停止动画" />
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
$("#custom").click(function () {
$("#one").animate({
width:"500",
fontSize:"100",
borderRadius:"50%"
},4000);
});
$("#custom2").click(function () {
$("#one").animate({
width:"+=50",
height:"-=20"
},2000);
});
$("#custom3").click(function () {
$("#one").animate({
height:"500"
},1000);
$("#one").animate({
width:"800"
},500);
$("#one").animate({
fontSize:"150"
},700);
$("#one").animate({
borderRadius:"50%"
},2000);
});
$("#stop").click(function () {
$("#one").stop(true,false);
});
</script>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>自定义动画</title>
<style type="text/css">
#one{
width: 300px;
height: 300px;
background-color: red;
color: #fff;
font-size: 50px;
line-height: 300px;
margin: 20px auto;
text-align: center;
}
</style>
</head>
<body>
<div id="one">动画</div>
<input type="button" name="" id="custom" value="自定义动画" />
<input type="button" name="" id="custom2" value="自定义动画2" />
<input type="button" name="" id="custom3" value="自定义动画3" />
<input type="button" name="" id="stop" value="停止动画" />
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
$("#custom").click(function () {
$("#one").animate({
width:"500",
fontSize:"100",
borderRadius:"50%"
},4000);
});
$("#custom2").click(function () {
$("#one").animate({
width:"+=50",
height:"-=20"
},2000);
});
$("#custom3").click(function () {
$("#one").animate({
height:"500"
},1000);
$("#one").animate({
width:"800"
},500);
$("#one").animate({
fontSize:"150"
},700);
$("#one").animate({
borderRadius:"50%"
},2000);
});
$("#stop").click(function () {
$("#one").stop(true,false);
});
</script>
</html>
相关文章推荐
- jq中三组动画和自定义动画
- Jq自定义动画
- jq-05动画&自定义动画
- jq 自定义动画animate
- 21种ANDROID自定义DIALOG_动画弹出对话框效果组件
- @keyframes自定义动画
- iOS学习之——自定义动画切换的相关的主要API
- 用js实现的模拟jquery的animate自定义动画(2.5K)
- jQuery插件animateToClass实现javascript自定义动画效果
- 自定义View--操作动画
- 继承Animation自定义动画
- iOS 自定义转场动画 persent&dismiss , push&pop
- 简单的自定义带有动画的checkbox
- iOS开发——UI进阶篇(十八)核心动画小例子,转盘(裁剪图片、自定义按钮、旋转)图片折叠、音量震动条、倒影、粒子效果
- 安卓自定义view仿小米商城购物车动画
- [android] 练习样式主题自定义activity切换动画
- win7开机动画自定义
- Android 自定义TextView实现文字渐变动画
- css自定义动画
- UIView 动画的参数传递 与 自定义方法