website/reveal/js/reveal.js
/**
	 * Updates the position of the parallax background based
	 * on the current slide index.
	 */
Updates the position of the parallax background based
on the current slide index.
Updates the position of the parallax background based on the current slide index .
function updateParallax() {
		if( config.parallaxBackgroundImage ) {
			var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ),
				verticalSlides = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR );
			var backgroundSize = dom.background.style.backgroundSize.split( ' ' ),
				backgroundWidth, backgroundHeight;
			if( backgroundSize.length === 1 ) {
				backgroundWidth = backgroundHeight = parseInt( backgroundSize[0], 10 );
			}
			else {
				backgroundWidth = parseInt( backgroundSize[0], 10 );
				backgroundHeight = parseInt( backgroundSize[1], 10 );
			}
			var slideWidth = dom.background.offsetWidth;
			var horizontalSlideCount = horizontalSlides.length;
			var horizontalOffset = -( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 ) * indexh;
			var slideHeight = dom.background.offsetHeight;
			var verticalSlideCount = verticalSlides.length;
			var verticalOffset = verticalSlideCount > 0 ? -( backgroundHeight - slideHeight ) / ( verticalSlideCount-1 ) * indexv : 0;
			dom.background.style.backgroundPosition = horizontalOffset + 'px ' + verticalOffset + 'px';
		}
	}
function updateParallax ( ) { if ( config . parallaxBackgroundImage ) { var horizontalSlides = document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR ) , verticalSlides = document . querySelectorAll ( VERTICAL_SLIDES_SELECTOR ) ; var backgroundSize = dom . background . style . backgroundSize . split ( ' ' ) , backgroundWidth , backgroundHeight ; if ( backgroundSize . length === 1 ) { backgroundWidth = backgroundHeight = parseInt ( backgroundSize [ 0 ] , 10 ) ; } else { backgroundWidth = parseInt ( backgroundSize [ 0 ] , 10 ) ; backgroundHeight = parseInt ( backgroundSize [ 1 ] , 10 ) ; } var slideWidth = dom . background . offsetWidth ; var horizontalSlideCount = horizontalSlides . length ; var horizontalOffset = - ( backgroundWidth - slideWidth ) / ( horizontalSlideCount - 1 ) * indexh ; var slideHeight = dom . background . offsetHeight ; var verticalSlideCount = verticalSlides . length ; var verticalOffset = verticalSlideCount > 0 ? - ( backgroundHeight - slideHeight ) / ( verticalSlideCount - 1 ) * indexv : 0 ; dom . background . style . backgroundPosition = horizontalOffset + 'px ' + verticalOffset + 'px' ; } }
Updates the position of the parallax background based
 on the current slide index.
Updates the position of the parallax background based on the current slide index .