<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
<style>
.box{
width: 200px;
height: 200px;
background: yellow;
/*display: none;*/
}
</style>
</head>
<body>
<button>按钮</button>
<div class="box"></div>
<script>
$("button").click(function(){
/*$(".box").show(3000,function(){
console.log(1)
})*/
/* $(".box").fadeOut(3000,function(){
console.log(1)
});*/
/*$(".box").slideUp(3000,function(){
console.log(1)
});*/
/* $(".box").slideDown(3000,function(){
console.log(1)
})*/
});
$(".box").animate({"width":"500px"},1000)
.animate({"width":"300px"},1000)
.animate({"width":"800px"},1000);
$("button").click(function(){
$(".box").stop(true,true);
});
</script>
</body>
</html>
JQuery的动画(显示、隐藏、淡出淡入、自定义动画)
最新推荐文章于 2019-05-05 10:37:07 发布