我希望第一个div显示并隐藏,然后下一个div应该显示并再次自动隐藏每5秒。目前此代码处于上滑状态,但如何将其更改为切换效果
这是jsfiddle:
javascript代码在这里:
$(function() {
$("#slideContainer").css({
"height" :$("#slideContainer div:first").css("height"
"overflow" : "hidden"
});
function slide() {
$("#slideContainer div:first").slideUp(800, function() {
var $this = $(this);
$this.parent().append(this);
$this.show();
slide();
});
}
slide();
});
html在这里:
<h1>Test of sliding stuff</h1>
<div id="slideContainer">
<div>Contact No: 555-666-7777</div>
<div>Email: me@me.com</div>
<div>Test: whatever</div>
<div>Add as many extra lines here as you like</div>
</div>
<div>Other page content here.</div>