jQuery动画的显示和隐藏
来源:互联网 发布:win7动态桌面壁纸软件 编辑:程序博客网 时间:2024/05/22 04:46
jQuery动画的显示和隐藏
用DW工具编写的,而且要导入js库
<!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>
- jQuery的动画-显示和隐藏
- jQuery动画的显示和隐藏
- jQuery动画-隐藏和显示
- JQuery显示和隐藏和动画代码
- JQuery操作div隐藏和显示的4种动画
- JQuery 动画显示和隐藏效果
- JQuery 动画显示和隐藏效果
- jQuery之动画基础隐藏和显示
- JQuery的动画(显示、隐藏、淡出淡入、自定义动画)
- jquery动画中显示、隐藏
- View的显示和隐藏动画
- jQuery之动画效果(动画基础隐藏和显示,上卷下拉效果 ,淡入淡出效果 ,动画切换的比较,自定义动画,jQuery核心)
- jQuery 隐藏和显示
- jquery显示和隐藏
- jQuery 隐藏和显示
- jquery隐藏和显示
- Jquery显示和隐藏
- Jquery显示和隐藏
- SpringCloud Config-----3、安全
- JavaScript 中typeof、instanceof 与 constructor 的区别?
- PAT-1063(计算谱半径)
- HTML5 与 HTML4 的区别(3)
- 开启程序员的学习记录之旅
- jQuery动画的显示和隐藏
- SpringCloud Config-----4、动态刷新配置
- nginx配置limit_req限制ip访问速率详解
- MSSQL查询统计
- 第49天-Linux操作系统原理1
- 算法 第四版 2.1.12
- xftp中文乱码
- Deep learning: Technical introduction
- SpringCloud Config-----2、配置中心集群