jQuery basic animation effects
Basic animation effect
show(spend,[callback]): Show hidden matching elements
hide(spend,[callback] ]): Hide the displayed element
toggle(switch): Switch the visible state of the element according to the switch parameter (true is visible, false is hidden).
toggle(spend,[callback]): Toggle the visible state of all matching elements with elegant animation
<!DOCTYPE html>
<html>
<head>
<title>php.cn</title>
<meta charset="utf-8" />
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script>
function f1(){
//隐藏 hidden
//hide([时间参数 毫秒级][,处理函数])
$('div').hide(3000,function(){
alert('我消失了,你能看到么');
});
}
function f2(){
//显示 show
//show([时间参数 毫秒级][,处理函数])
$('div').show(3000,function(){
alert('我又回来了');
});
}
function f3(){
$('div').toggle(2000);
}
</script>
<style type="text/css">
div {width:300px; height:200px; background-color:yellow;}
</style>
</head>
<body>
<div></div>
<input type="button" value="隐藏" onclick="f1()" />
<input type="button" value="显示" onclick="f2()" />
<input type="button" value="开关" onclick="f3()" />
</body>
</html>
new file
<!DOCTYPE html>
<html>
<head>
<title>php.cn</title>
<meta charset="utf-8" />
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script>
function f1(){
//隐藏 hidden
//hide([时间参数 毫秒级][,处理函数])
$('div').hide(3000,function(){
alert('我消失了,你能看到么');
});
}
function f2(){
//显示 show
//show([时间参数 毫秒级][,处理函数])
$('div').show(3000,function(){
alert('我又回来了');
});
}
function f3(){
$('div').toggle(2000);
}
</script>
<style type="text/css">
div {width:300px; height:200px; background-color:yellow;}
</style>
</head>
<body>
<div></div>
<input type="button" value="隐藏" onclick="f1()" />
<input type="button" value="显示" onclick="f2()" />
<input type="button" value="开关" onclick="f3()" />
</body>
</html>
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
















