jQuery各种动画效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
#d1
{
background-color:Red;
width:400px;
height:400px;
}
</style>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
//往右下方放
$("#btn1").click(function () {
$("#d1").show(3000);
});
//往左上收
$("#btn2").click(function () {
$("#d1").hide("slow");
});
//来回显示和回收
$("#btn3").click(function () {
$("#d1").toggle(1000);
})
//暂停
$("#btn4").click(function () {
$("#d1").stop();
})
//垂直往上
$("#btn5").click(function () {
$("#d1").slideUp(3000);
})
//垂直向下
$("#btn6").click(function () {
$("#d1").slideDown(3000);
})
//模仿QQ效果
$("#d1").click(function () {
$("#d1").slideUp(3000);
})
//颜色变暗,退出
$("#btn7").click(function () {
$("#d1").fadeOut(3000);
})
//颜色变亮,显示
$("#btn8").click(function () {
$("#d1").fadeIn(3000);
})
})
</script>
</head>
<body>
<div id="d1">
</div>
<input id="btn1" type="button" value="show"/><br />
<input id="btn2" type="button" value="hide"/><br />
<input id="btn3" type="button" value="toggle"/><br />
<input id="btn4" type="button" value="stop"/><br />
<input id="btn5" type="button" value="slideUp"/><br />
<input id="btn6" type="button" value="slideDown"/><br />
<input id="btn7" type="button" value="fadeOut"/><br />
<input id="btn8" type="button" value="fadeIn"/><br />
</body>
</html>

转载于:https://www.cnblogs.com/java20130723/archive/2013/03/31/3211462.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值