Add support for slide transition (Issue #59).
This commit is contained in:
parent
abbb7c282b
commit
8c085b8809
|
@ -88,6 +88,26 @@
|
||||||
progress.style.width = (100 / (slideList.length - 1) * normalizeSlideNumber(slideNumber)).toFixed(2) + '%';
|
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) {
|
function getSlideHash(slideNumber) {
|
||||||
return '#' + slideList[normalizeSlideNumber(slideNumber)].id;
|
return '#' + slideList[normalizeSlideNumber(slideNumber)].id;
|
||||||
}
|
}
|
||||||
|
@ -97,6 +117,7 @@
|
||||||
|
|
||||||
if (!isListMode()) {
|
if (!isListMode()) {
|
||||||
updateProgress(slideNumber);
|
updateProgress(slideNumber);
|
||||||
|
updateCurrentAndPassedSlides(slideNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue