你能告訴我怎樣才能上下邊框,然後滑下來揭示另一個div的內容。我希望內容div中的文本以與消息框底部邊框相同的速度向下滑動。Slideup and Slidedown to reveal a 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');
});
謝謝凱文。它現在在工作。最好的祝福。 – user2275009
@ user2275009優秀,請接受它的工作。 –