website/reveal/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
	 * @param {int} f Optional index of a fragment within the
	 * target slide to activate
	 * @param {int} o Optional origin for use in multimaster environments
	 */
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
@param {int} f Optional index of a fragment within the
target slide to activate
@param {int} o Optional origin for use in multimaster environments
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 @param { int } f Optional index of a fragment within the target slide to activate @param { int } o Optional origin for use in multimaster environments
function slide( h, v, f, o ) {
		previousSlide = currentSlide;
		var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
		if( v === undefined ) {
			v = getPreviousVerticalIndex( horizontalSlides[ h ] );
		}
		if( previousSlide && previousSlide.parentNode && previousSlide.parentNode.classList.contains( 'stack' ) ) {
			setPreviousVerticalIndex( previousSlide.parentNode, indexv );
		}
		var stateBefore = state.concat();
		state.length = 0;
		var indexhBefore = indexh || 0,
			indexvBefore = indexv || 0;
		indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h );
		indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v );
		updateSlidesVisibility();
		layout();
		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( isOverview() ) {
			activateOverview();
		}
		var currentHorizontalSlide = horizontalSlides[ indexh ],
			currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
		currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;
		if( typeof f !== 'undefined' ) {
			navigateFragment( f );
		}
		var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore );
		if( slideChanged ) {
			dispatchEvent( 'slidechanged', {
				'indexh': indexh,
				'indexv': indexv,
				'previousSlide': previousSlide,
				'currentSlide': currentSlide,
				'origin': o
			} );
		}
		else {
			previousSlide = null;
		}
		if( previousSlide ) {
			previousSlide.classList.remove( 'present' );
			if ( document.querySelector( HOME_SLIDE_SELECTOR ).classList.contains( 'present' ) ) {
				setTimeout( function () {
					var slides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.stack') ), i;
					for( i in slides ) {
						if( slides[i] ) {
							setPreviousVerticalIndex( slides[i], 0 );
						}
					}
				}, 0 );
			}
		}
		if( slideChanged ) {
			stopEmbeddedContent( previousSlide );
			startEmbeddedContent( currentSlide );
		}
		updateControls();
		updateProgress();
		updateBackground();
		updateParallax();
		updateSlideNumber();
		writeURL();
		cueAutoSlide();
	}
function slide ( h , v , f , o ) { previousSlide = currentSlide ; var horizontalSlides = document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR ) ; if ( v === undefined ) { v = getPreviousVerticalIndex ( horizontalSlides [ h ] ) ; } if ( previousSlide && previousSlide . parentNode && previousSlide . parentNode . classList . contains ( 'stack' ) ) { setPreviousVerticalIndex ( previousSlide . parentNode , indexv ) ; } var stateBefore = state . concat ( ) ; state . length = 0 ; var indexhBefore = indexh || 0 , indexvBefore = indexv || 0 ; indexh = updateSlides ( HORIZONTAL_SLIDES_SELECTOR , h === undefined ? indexh : h ) ; indexv = updateSlides ( VERTICAL_SLIDES_SELECTOR , v === undefined ? indexv : v ) ; updateSlidesVisibility ( ) ; layout ( ) ; 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 ( isOverview ( ) ) { activateOverview ( ) ; } var currentHorizontalSlide = horizontalSlides [ indexh ] , currentVerticalSlides = currentHorizontalSlide . querySelectorAll ( 'section' ) ; currentSlide = currentVerticalSlides [ indexv ] || currentHorizontalSlide ; if ( typeof f !== 'undefined' ) { navigateFragment ( f ) ; } var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore ) ; if ( slideChanged ) { dispatchEvent ( 'slidechanged' , { 'indexh' : indexh , 'indexv' : indexv , 'previousSlide' : previousSlide , 'currentSlide' : currentSlide , 'origin' : o } ) ; } else { previousSlide = null ; } if ( previousSlide ) { previousSlide . classList . remove ( 'present' ) ; if ( document . querySelector ( HOME_SLIDE_SELECTOR ) . classList . contains ( 'present' ) ) { setTimeout ( function ( ) { var slides = toArray ( document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR + '.stack' ) ) , i ; for ( i in slides ) { if ( slides [ i ] ) { setPreviousVerticalIndex ( slides [ i ] , 0 ) ; } } } , 0 ) ; } } if ( slideChanged ) { stopEmbeddedContent ( previousSlide ) ; startEmbeddedContent ( currentSlide ) ; } updateControls ( ) ; updateProgress ( ) ; updateBackground ( ) ; updateParallax ( ) ; updateSlideNumber ( ) ; writeURL ( ) ; cueAutoSlide ( ) ; }
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 // Query all horizontal slides in the deck // If no vertical index is specified and the upcoming slide is a // stack, resume at its previous vertical index // If we were on a vertical stack, remember what vertical index // it was on so we can resume at the same position when returning // Remember the state before this slide // Reset the state array // Activate and transition to the new slide // Update the visibility of slides now that the indices have changed // 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 remains of the previous state // If the overview is active, re-activate it to update positions // Find the current horizontal slide and any possible vertical slides // within it // Store references to the previous and current slides // Show fragment, if specified // 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 // Reset all slides upon navigate to home // Issue: #285 // Launch async task // Reset stack // Handle embedded content // Update the URL hash