이 작업을 중단하고 중단 할 수 있습니다. 그 사이에 3 초 지연이있는 1 초의 페이드 인과 1 초의 페이드 아웃이 있어야하지만 3 초 또는 1 초의 페이드 인/페이드 아웃 중에는 이전 작업을 중지하고 완료하지 않아야하는 다른 작업이 발생할 수 있습니다. 예를 들어 3 초 동안 이미지가 나타나면 사용자는 next/next/next/next로 이동하기를 원하기 때문에 이전에 시작된 애니메이션을 완료하지 않고 즉시 애니메이션을 중단하고 다음/다음/다음/다음 (여러 사용자 클릭)으로 이동해야합니다. 이.jQuery 페이드 인/아웃 및 지연, 이전 애니메이션 취소
외부 통화 : SlideShow (1); 또는 슬라이드 쇼 (-1); 등
이 1S 여기slides.eq(slideCount).fadeIn(fadeInAmount).delay(fadeDelay).addClass('jqImage').fadeOut(fadeOutAmount,function() {
slideCount = (slideCount+increment) % totalSlides;
SlideShow(0);
});
을 페이드 fadein 1S, 3S 지연과 시작점은 하나의 비 작동을 시도하여에서는 setTimeout하였습니다
function SlideShow(action) {
slideCount = (slideCount+action) % totalSlides;
slides.eq(slideCount).fadeIn(fadeInAmount);
// add 3 second delay/SetTimeout/etc here
// how should setTimeout be involved here so that it, and the fadein/fadeout are stoppable (without ever continuing)
slides.eq(slideCount).fadeOut(fadeOutAmount,function() {
slideCount = (slideCount+increment) % totalSlides;
SlideShow(0);
});
}
:
function timerStop() {
if (runningTimer) {
clearTimeout(runningTimer);
runningTimer = 0;
}
}
var runningTimer;
function SlideShow(action) {
// $('body').stop(); slides.eq(slideCount).dequeue(); slides.eq(slideCount).stop();
slideCount=(slideCount+action) % totalSlides;
$('#slideControls').html(
(slideCount+1) + "/" + totalSlides
+ "<br>" + "Delay: " + fadeDelay/1000
+ "<br>" + "Skip: " + increment
);
$('#slideStatusbar').html(slides.eq(slideCount).find('img').attr('src').replace(/^.*[\\\/]/, '')); // Filename only
//slides.eq(slideCount).fadeIn(fadeInAmount).delay(fadeDelay).addClass('jqImage').fadeOut(fadeOutAmount,function() {
// slideCount < totalSlides-1 ? slideCount+=increment : slideCount=0;
// slideCount = (slideCount+increment) % totalSlides;
// SlideShow(0);
// slides.eq(slideCount).addClass('jqImage');
slides.eq(slideCount).fadeIn(fadeInAmount);
runningTimer=setTimeout(function(){
slides.eq(slideCount).fadeOut(fadeOutAmount,function() {
slideCount = (slideCount + increment) % totalSlides; //slideCount = (slideCount + (action ? action : increment)) % totalSlides;
SlideShow(0);
});
}, 1000);
}
"증가"는 (50)에서 설정된 전역 변수는, (50 개) 이미지는 사용자의 개입없이 자동으로 스킵되고 있지만, 사용자는 다음/이전 누를 경우,이 다음/이전 할 모든 것을 삭제하고 (50) 증가를 재개 사용자의 다음/이전 이미지가 페이드 인하면 지연 상태가 유지되고 페이드 아웃됩니다. – Roberto
아무도 도움이 될 수 있습니까? – Roberto
여전히 고민 중입니다 – Roberto