0

http://kennenmen.netai.net/home.php

私はこれを数時間いじっていましたが、ほぼ完了しました。私に問題を引き起こしている唯一のことは、スライドショーがすべての画像を循環した後に一時停止する理由が分からないことです. なぜそれがそれをしているのか誰にも分かりますか?

function slideSwitch() {
 var $active = $('#slideshow img.active');
if ($active.is(':last')) {
    $active.hide().removeClass('active');
    $('#slideshow img:first').show().addClass('active');
}else{
    $active.hide().removeClass('active').next().show().addClass('active');
}
}

$(function () {
$('#slideshow img').not('.active').hide()
setInterval(slideSwitch, 1000);
});
4

1 に答える 1

0

テストされていませんが、次のように の代わりに を使用してみてsetIntervalくださいsetTimeout

$(function () {
    $('#slideshow img').not('.active').hide()
    setInterval(slideSwitch, 8000);    // this depends on how many images there are 
});
于 2013-04-07T06:40:13.407 に答える