你能告诉我如何将带有顶部和底部边框的 div 向上滑动,然后向下滑动以显示另一个 div 的内容。我希望内容 div 中的文本以与消息框底部边框相同的速度向下滑动。
HTML是
<div id="message-box">
<div id="content">
Lorem ipsum dolor sit amet, minim accusamus dignissim has at, nec esse quas postea in. Vide harum id mei, aperiam legimus delectus an est. Sit quidam verear voluptatum ad, vim definiebas reprimique cu. Eu sea bonorum meliore, possim albucius complectitur vel et. Eum ne ferri persius abhorreant, mel in probatus pertinax, ex usu meliore corpora.
</div>
</div>
CSS是:
#message-box {
position:absolute;
left:20px;
top:40px;
height:450px;
width:200px;
background:#eee;
margin-left:0px;
text-align:center;
border-top: solid 1px #000;
border-bottom:solid 1px #000;
}
#content {
position:relative;
top:0px;
height:350px;
font-size:16px;
padding:20px;
color:#000;
display:none;
}
Jquery 是:
var speed = 500;
$('document').ready(function() {
$('#message-box').slideUp(speed).delay(50).slideDown('speed');
});