我希望第一个 div 出现并隐藏,然后下一个 div 应该出现并每隔 5 秒自动隐藏一次。目前此代码在 Slide up 但如何更改它以切换效果
这是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>