diff --git a/js/reveal.js b/js/reveal.js index 25f0dcf7..e7561100 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2871,8 +2871,13 @@ if( !slide && currentSlide ) { var hasFragments = currentSlide.querySelectorAll( '.fragment' ).length > 0; if( hasFragments ) { - var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' ); - f = visibleFragments.length - 1; + var currentFragment = currentSlide.querySelector( '.current-fragment' ); + if( currentFragment && currentFragment.hasAttribute( 'data-fragment-index' ) ) { + f = parseInt( currentFragment.getAttribute( 'data-fragment-index' ), 10 ); + } + else { + f = currentSlide.querySelectorAll( '.fragment.visible' ).length - 1; + } } }