jQuery动画效果之show,hide和回调函数

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>iQuery的动画效果</title>
<meta charset="UTF-8">
</head>
<body>
<p style="display: none">hello p</p>
<input id="show" value="显示" type="button">
<input id="hide" value="隐藏" type="button">
<input id="toggle" value="switch" type="button">
<script src="jquery-3.4.1.js"></script>
<script>
//回调函数:当用1秒完成了show方法之后,如果成功了就去执行该函数
$('#show').click(function () {
$('p').show(1000,function () {
alert('♥');
});

})
$('#hide').click(function () {
// $('p').css('display','none');
$('p').hide(1000);

})
$('#toggle').click(function () {
$('p').toggle(1000);

})

</script>
</body>
</html>


posted @ 2020-02-19 11:32  Stary_tx  阅读(764)  评论(0编辑  收藏  举报