jQuery动画
来源:互联网 发布:android studio 源码 编辑:程序博客网 时间:2024/06/13 20:08
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery动画</title>
<script src="../jquery-2.1.0.js"></script>
<script src="../jquery-color-master/jquery.color.js"></script>
<script>
$(function(){
$("#btn1").click(function(){
//$("img").hide();
$("img").hide(2000,function(){
var size = $("img:hidden").length;
alert("动画隐藏了"+size+"个");
});
});
$("#btn2").click(function(){
//$("img").hide();
$("img").show(2000,function(){
var size = $("img:visible").size();
alert("动画显示了"+size+"个");
});
});
$("#btn3").click(function(){
//$("img").hide();
$("img").toggle(2000,function(){
});
});
$("#btn4").click(function(){
//$("img").hide();
$("img").slideUp(2000,function(){
var size = $("img:hidden").length;
alert("动画隐藏了"+size+"个");
});
});
$("#btn5").click(function(){
//$("img").hide();
$("img").slideDown(2000,function(){
var size = $("img:visible").size();
alert("动画显示了"+size+"个");
});
});
$("#btn6").click(function(){
//$("img").hide();
$("img").slideToggle(2000,function(){
});
});
$("#btn7").click(function(){
//$("img").hide();
$("img").fadeOut(2000,function(){
});
});
$("#btn8").click(function(){
//$("img").hide();
$("img").fadeTo(1000,0.01,function(){
});
});
$("#go").click(function(){
$("#block").animate({
width: "90%",
height: "100%",
fontSize: "10em"
}, 1000 )
.animate({
borderWidth: 10,
opacity:0.2,
backgroundColor:"red"
},1000);
});
$("#right").click(function(){
$(".block2").animate({left: '+50px'}, "slow");
});
$("#left").click(function(){
$(".block2").animate({left: '-50px'}, "slow");
});
$("#btn9").click(function(){
$("#block").stop(true,true);
});
});
</script>
</head>
<body>
<button id="btn1">隐藏</button>
<button id="btn2">显示</button>
<button id="btn3">显隐切换</button>
<button id="btn4">隐藏2</button>
<button id="btn5">显示2</button>
<button id="btn6">显隐切换2</button>
<button id="btn7">透明2(淡出)</button>
<button id="btn8">指定透明度</button>
<br/><br/><img src="f.jpg.png" style="width:200px; height:200px" />
<button id="go"> Run</button>
<button id="btn9">停止动画</button>
<div id="block" style="border:1px solid #33F; background-color:#FFC">Hello!</div>
<center>
<button id="left">«</button> <button id="right">»</button>
<div class="block2" style="position:absolute; width:50px; height:50px; background-color:#CF9">asdf</div>
</center>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery动画</title>
<script src="../jquery-2.1.0.js"></script>
<script src="../jquery-color-master/jquery.color.js"></script>
<script>
$(function(){
$("#btn1").click(function(){
//$("img").hide();
$("img").hide(2000,function(){
var size = $("img:hidden").length;
alert("动画隐藏了"+size+"个");
});
});
$("#btn2").click(function(){
//$("img").hide();
$("img").show(2000,function(){
var size = $("img:visible").size();
alert("动画显示了"+size+"个");
});
});
$("#btn3").click(function(){
//$("img").hide();
$("img").toggle(2000,function(){
});
});
$("#btn4").click(function(){
//$("img").hide();
$("img").slideUp(2000,function(){
var size = $("img:hidden").length;
alert("动画隐藏了"+size+"个");
});
});
$("#btn5").click(function(){
//$("img").hide();
$("img").slideDown(2000,function(){
var size = $("img:visible").size();
alert("动画显示了"+size+"个");
});
});
$("#btn6").click(function(){
//$("img").hide();
$("img").slideToggle(2000,function(){
});
});
$("#btn7").click(function(){
//$("img").hide();
$("img").fadeOut(2000,function(){
});
});
$("#btn8").click(function(){
//$("img").hide();
$("img").fadeTo(1000,0.01,function(){
});
});
$("#go").click(function(){
$("#block").animate({
width: "90%",
height: "100%",
fontSize: "10em"
}, 1000 )
.animate({
borderWidth: 10,
opacity:0.2,
backgroundColor:"red"
},1000);
});
$("#right").click(function(){
$(".block2").animate({left: '+50px'}, "slow");
});
$("#left").click(function(){
$(".block2").animate({left: '-50px'}, "slow");
});
$("#btn9").click(function(){
$("#block").stop(true,true);
});
});
</script>
</head>
<body>
<button id="btn1">隐藏</button>
<button id="btn2">显示</button>
<button id="btn3">显隐切换</button>
<button id="btn4">隐藏2</button>
<button id="btn5">显示2</button>
<button id="btn6">显隐切换2</button>
<button id="btn7">透明2(淡出)</button>
<button id="btn8">指定透明度</button>
<br/><br/><img src="f.jpg.png" style="width:200px; height:200px" />
<button id="go"> Run</button>
<button id="btn9">停止动画</button>
<div id="block" style="border:1px solid #33F; background-color:#FFC">Hello!</div>
<center>
<button id="left">«</button> <button id="right">»</button>
<div class="block2" style="position:absolute; width:50px; height:50px; background-color:#CF9">asdf</div>
</center>
</body>
</html>
阅读全文
0 0
- jQuery动画
- jquery动画
- jQuery动画
- jQuery动画
- jQuery动画
- jquery 动画
- JQuery动画
- jquery 动画
- jQuery动画
- jquery动画
- jquery动画
- jQuery-动画
- jquery动画
- jquery动画
- jQuery动画
- jQuery动画
- jQuery动画
- jquery 动画
- sprigboot的配置文件
- 掉坑记录--two pointer
- equals与==背后的装箱拆箱机制
- Spark计算相关性系数(皮尔森、斯皮尔曼、卡方检验)
- 搜索引擎开发(1)资料收集
- jQuery动画
- PAT甲级1002. A+B for Polynomials (25)
- bzoj2152点分治
- springmvc 简单的注解
- windows 下Python 安装Pillow
- python3.6——if __name__=='__main__'的使用
- python3 NameError: name 'xrange' is not defined
- P, NP, NP-complete, NP hard问题
- 1073: 级数求和