jQuery动画详解
css样式
button {
display: block;
margin: 0 auto 20px;
}
div {
width: 100px;
height: 100px;
background: #ff4466;
margin: 0 auto;
display: none;
}
html内容
<button name="block">点我出现</button>
<button name="none">点我消失</button>
<button name="toggle">点我切换</button>
<div></div>
jQuery动画一之显示、隐藏、切换
1、show() 显示效果,让隐藏的标签显示
语法:标签对象.show(参数1,参数2,参数3)
参数1:动画的执行时间,单位为毫秒,
参数2:运动的方向, linear 线性运动,
参数3:回调函数,当运动结束时,执行的函数程序
jQuery内容
$('[name = "block"]').click(function() {
$('div').show(1000, 'linear', function() {
console.log('标签显示');
}<