Update slide ready and change event to improve performance

This commit is contained in:
Wu Cheng-Han 2016-08-15 11:28:48 +08:00
parent 8124d6f2d6
commit 29d198def9
1 changed files with 9 additions and 6 deletions

View File

@ -98,12 +98,15 @@ function renderSlide(event) {
markdown.attr('data-rendered', 'true');
document.title = title;
Reveal.layout();
}
}
Reveal.addEventListener('ready', function (event) {
renderSlide(event);
var markdown = $(event.currentSlide);
// force browser redraw
setTimeout(function () {
markdown.hide().show(0);
}, 0);
}
}
Reveal.addEventListener('ready', renderSlide);
});
Reveal.addEventListener('slidechanged', renderSlide);