js/reveal.js
/**
	 * Steps from the current point in the presentation to the
	 * slide which matches the specified horizontal and vertical
	 * indices.
	 *
	 * @param {int} h Horizontal index of the target slide
	 * @param {int} v Vertical index of the target slide
	 */
Steps from the current point in the presentation to the
slide which matches the specified horizontal and vertical
indices.

@param {int} h Horizontal index of the target slide
@param {int} v Vertical index of the target slide
Steps from the current point in the presentation to the slide which matches the specified horizontal and vertical indices . @param { int } h Horizontal index of the target slide @param { int } v Vertical index of the target slide
function slide( h, v ) {
		previousSlide = currentSlide;
		var stateBefore = state.concat();
		state.length = 0;
		var indexhBefore = indexh,
			indexvBefore = indexv;
		indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h );
		indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v );
		stateLoop: for( var i = 0, len = state.length; i < len; i++ ) {
			for( var j = 0; j < stateBefore.length; j++ ) {
				if( stateBefore[j] === state[i] ) {
					stateBefore.splice( j, 1 );
					continue stateLoop;
				}
			}
			document.documentElement.classList.add( state[i] );
			dispatchEvent( state[i] );
		}
		while( stateBefore.length ) {
			document.documentElement.classList.remove( stateBefore.pop() );
		}
		if( config.progress && dom.progress ) {
			dom.progressbar.style.width = ( indexh / ( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length - 1 ) ) * window.innerWidth + 'px';
		}
		if( isOverviewActive() ) {
			activateOverview();
		}
		updateControls();
		clearTimeout( writeURLTimeout );
		writeURLTimeout = setTimeout( writeURL, 1500 );
		var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
		var currentHorizontalSlide = horizontalSlides[ indexh ],
			currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
		currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;
		if( indexh !== indexhBefore || indexv !== indexvBefore ) {
			dispatchEvent( 'slidechanged', {
				'indexh': indexh,
				'indexv': indexv,
				'previousSlide': previousSlide,
				'currentSlide': currentSlide
			} );
		}
		else {
			previousSlide = null;
		}
		if( previousSlide ) {
			previousSlide.classList.remove( 'present' );
		}
	}
function slide ( h , v ) { previousSlide = currentSlide ; var stateBefore = state . concat ( ) ; state . length = 0 ; var indexhBefore = indexh , indexvBefore = indexv ; indexh = updateSlides ( HORIZONTAL_SLIDES_SELECTOR , h === undefined ? indexh : h ) ; indexv = updateSlides ( VERTICAL_SLIDES_SELECTOR , v === undefined ? indexv : v ) ; stateLoop : for ( var i = 0 , len = state . length ; i < len ; i ++ ) { for ( var j = 0 ; j < stateBefore . length ; j ++ ) { if ( stateBefore [ j ] === state [ i ] ) { stateBefore . splice ( j , 1 ) ; continue stateLoop ; } } document . documentElement . classList . add ( state [ i ] ) ; dispatchEvent ( state [ i ] ) ; } while ( stateBefore . length ) { document . documentElement . classList . remove ( stateBefore . pop ( ) ) ; } if ( config . progress && dom . progress ) { dom . progressbar . style . width = ( indexh / ( document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR ) . length - 1 ) ) * window . innerWidth + 'px' ; } if ( isOverviewActive ( ) ) { activateOverview ( ) ; } updateControls ( ) ; clearTimeout ( writeURLTimeout ) ; writeURLTimeout = setTimeout ( writeURL , 1500 ) ; var horizontalSlides = document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR ) ; var currentHorizontalSlide = horizontalSlides [ indexh ] , currentVerticalSlides = currentHorizontalSlide . querySelectorAll ( 'section' ) ; currentSlide = currentVerticalSlides [ indexv ] || currentHorizontalSlide ; if ( indexh !== indexhBefore || indexv !== indexvBefore ) { dispatchEvent ( 'slidechanged' , { 'indexh' : indexh , 'indexv' : indexv , 'previousSlide' : previousSlide , 'currentSlide' : currentSlide } ) ; } else { previousSlide = null ; } if ( previousSlide ) { previousSlide . classList . remove ( 'present' ) ; } }
Steps from the current point in the presentation to the
 slide which matches the specified horizontal and vertical
 indices.
Steps from the current point in the presentation to the slide which matches the specified horizontal and vertical indices .
// Remember where we were at before // Remember the state before this slide // Reset the state array // Activate and transition to the new slide // Apply the new state // Check if this state existed on the previous slide. If it // did, we will avoid adding it repeatedly. // Dispatch custom event matching the state's name // Clean up the remaints of the previous state // Update progress if enabled // If the overview is active, re-activate it to update positions // Update the URL hash after a delay since updating it mid-transition // is likely to cause visual lag // Query all horizontal slides in the deck // Find the current horizontal slide and any possible vertical slides // within it // Store references to the previous and current slides // Dispatch an event if the slide changed // Ensure that the previous slide is never the same as the current // Solves an edge case where the previous slide maintains the // 'present' class when navigating between adjacent vertical // stacks