因错误的问题格式而被删除
答案 0 :(得分:1)
您不需要插件:
HTML:
<div><a id="close" href="javascript:void(0);">close</a></div>
<div id="content">content</div>
的JavaScript
$(function() {
$('#close').click(function() { $('#content').slideUp(1000); });
});
答案 1 :(得分:1)
是的,你是对的,是slideToggle
。示例:
HTML:
<html>
<head> ... </head>
<body>
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>
</body>
</html>
jQuery的:
$(document).ready(function(){
$("#flip").click(function(){
$("#panel").slideToggle("slow");
});
});
CSS:
#panel,#flip {
padding:5px;
text-align:center;
background-color:#e5eecc;
border:solid 1px #c3c3c3;
}
#panel {
padding:50px;
display:none;
}