我有一个报价旋转设置,一次显示两个引号,并在各地之间跳跃时,它应该只是在每个之间平稳旋转。 我无法弄清楚发生了什么问题。看到它在行动这里 - http://jsfiddle.net/RF3xK/1/jQuery报价旋转使用slideUp和slideDown
代码如下,
<div id="quotes">
<div class="textItem">
testing the quotes testing the quotes
</div>
<div class="textItem">
asdfdsaf sdf sdf sdf sf sd fsdaf sdf sdaf sdfsd f ds f dsf asdfsdafdsaf asdfdsaf sdf sdf sdf sf sd fsdaf sdf sdaf sdfsd f ds f dsf asdfsdafdsaf
</div>
<div class="textItem">
and another one
</div>
和jQuery的
$(document).ready(function() {
$('#quotes .textItem').hide();
InOut($('#quotes .textItem:first'));
function InOut(elem) {
elem.delay().slideUp(800).delay(0).slideDown(0, function() {
if (elem.next().length > 0) {
InOut($(this).next());
}
else {
InOut($(this).siblings(':first'));
}
});
}
$('#quotes .textItem').mouseover(function() {
$(this).stop(true, true);
});
$('#quotes .textItem').mouseout(function() {
if ($(this).is(":visible") == true) {
InOut($(this));
}
});
});
它似乎按照我的意图工作..究竟是什么问题? – 2013-02-20 00:43:22
什么是'elem.delay()。slideUp(800).delay(0).slideDown(0,'应该这样做?向上滑动800ms,然后立即向下滑动? – Fresheyeball 2013-02-20 01:30:18