이 코드 조각은 내 웹 사이트의 이미지 슬라이더를 담당하는 것으로 보입니다 (현재 온라인 상태가 아닙니다). 슬라이드 간의 지연을 사용자 정의하고 싶습니다. 끝에서 '5000'을 '10000'또는 '900000'또는 다른 것으로 변경해 보았지만 효과가 전혀 없습니다. 내가 도대체 뭘 잘못하고있는 겁니까?이 스크립트에서 지연을 사용자 정의하는 방법은 무엇입니까?
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ($active.length == 0) $active = $('#slideshow IMG:last');
// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first');
// uncomment the 3 lines below to pull the images in random order
// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length);
// var $next = $($sibs[ rndNum ]);
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1500, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval("slideSwitch()", 5000);
});
애니메이션 속도를 2로 변경하고 setInterval에 로그를 남기고 로그와 지속 시간이 – Sedz
인 경우이 것이 중요하다고 생각하지 않지만 'slideSwitch()'를 'slideSwitch' –