0
这是我在这里的第一篇文章,但我已经用这个网站作为一个很好的参考多年。我只是试图让我的幻灯片暂停,当我把它悬停。代码如下。我试图使用jquery悬停来阻止它,但我没有任何成功。有人有主意吗?暂停它的动画时
$(function() {
// create the image rotator
setInterval("rotateImages()", 7000);
});
function rotateImages() {
var oCurPhoto = $('#photoShow div.current');
var oNxtPhoto = oCurPhoto.next();
if (oNxtPhoto.length == 0)
oNxtPhoto = $('#photoShow div:first');
oCurPhoto.removeClass('current').addClass('previous');
oNxtPhoto.css({ opacity: 0.0 }).addClass('current').animate({ opacity: 1.0 }, 1000,
function() {
oCurPhoto.removeClass('previous');
});
}
你应该包括你试过没有工作的代码。 –
太棒了!感谢尼科斯!当我将它插入我们的开发环境时,它工作正常。我很忙,所以下次我会发布我的代码给其他人看。 –