website/reveal/js/reveal.js
/**
	 * Optimization method; hide all slides that are far away
	 * from the present slide.
	 */
Optimization method; hide all slides that are far away
from the present slide.
Optimization method ; hide all slides that are far away from the present slide .
function updateSlidesVisibility() {
		var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ),
			horizontalSlidesLength = horizontalSlides.length,
			distanceX,
			distanceY;
		if( horizontalSlidesLength ) {
			var viewDistance = isOverview() ? 10 : config.viewDistance;
			if( isMobileDevice ) {
				viewDistance = isOverview() ? 6 : 1;
			}
			for( var x = 0; x < horizontalSlidesLength; x++ ) {
				var horizontalSlide = horizontalSlides[x];
				var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ),
					verticalSlidesLength = verticalSlides.length;
				distanceX = Math.abs( ( indexh - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0;
				horizontalSlide.style.display = distanceX > viewDistance ? 'none' : 'block';
				if( verticalSlidesLength ) {
					var oy = getPreviousVerticalIndex( horizontalSlide );
					for( var y = 0; y < verticalSlidesLength; y++ ) {
						var verticalSlide = verticalSlides[y];
						distanceY = x === indexh ? Math.abs( indexv - y ) : Math.abs( y - oy );
						verticalSlide.style.display = ( distanceX + distanceY ) > viewDistance ? 'none' : 'block';
					}
				}
			}
		}
	}
function updateSlidesVisibility ( ) { var horizontalSlides = toArray ( document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR ) ) , horizontalSlidesLength = horizontalSlides . length , distanceX , distanceY ; if ( horizontalSlidesLength ) { var viewDistance = isOverview ( ) ? 10 : config . viewDistance ; if ( isMobileDevice ) { viewDistance = isOverview ( ) ? 6 : 1 ; } for ( var x = 0 ; x < horizontalSlidesLength ; x ++ ) { var horizontalSlide = horizontalSlides [ x ] ; var verticalSlides = toArray ( horizontalSlide . querySelectorAll ( 'section' ) ) , verticalSlidesLength = verticalSlides . length ; distanceX = Math . abs ( ( indexh - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0 ; horizontalSlide . style . display = distanceX > viewDistance ? 'none' : 'block' ; if ( verticalSlidesLength ) { var oy = getPreviousVerticalIndex ( horizontalSlide ) ; for ( var y = 0 ; y < verticalSlidesLength ; y ++ ) { var verticalSlide = verticalSlides [ y ] ; distanceY = x === indexh ? Math . abs ( indexv - y ) : Math . abs ( y - oy ) ; verticalSlide . style . display = ( distanceX + distanceY ) > viewDistance ? 'none' : 'block' ; } } } } }
Optimization method; hide all slides that are far away
 from the present slide.
Optimization method ; hide all slides that are far away from the present slide .
// Select all slides and convert the NodeList result to // an array // The number of steps away from the present slide that will // be visible // Limit view distance on weaker devices // Loops so that it measures 1 between the first and last slides // Show the horizontal slide if it's within the view distance