Add support for slide transition (Issue #59).

This commit is contained in:
Oleg Roschupkin 2012-03-01 15:32:49 +09:00
parent abbb7c282b
commit 8c085b8809
1 changed files with 21 additions and 0 deletions

View File

@ -88,6 +88,26 @@
progress.style.width = (100 / (slideList.length - 1) * normalizeSlideNumber(slideNumber)).toFixed(2) + '%';
}
function updateCurrentAndPassedSlides(slideNumber) {
var i, l = slideList.length, slide;
slideNumber = normalizeSlideNumber(slideNumber);
for ( i = 0; i < l; ++i ) {
slide = document.getElementById(slideList[i].id);
if ( i < slideNumber ) {
slide.classList.remove('current');
slide.classList.add('passed');
} else if ( i > slideNumber ) {
slide.classList.remove('passed');
slide.classList.remove('current');
} else {
slide.classList.remove('passed');
slide.classList.add('current');
}
}
}
function getSlideHash(slideNumber) {
return '#' + slideList[normalizeSlideNumber(slideNumber)].id;
}
@ -97,6 +117,7 @@
if (!isListMode()) {
updateProgress(slideNumber);
updateCurrentAndPassedSlides(slideNumber);
}
}