add support for iframe backgrounds
This commit is contained in:
parent
588472c520
commit
490ae90de4
20
js/reveal.js
20
js/reveal.js
|
@ -672,6 +672,7 @@
|
||||||
backgroundSize: slide.getAttribute( 'data-background-size' ),
|
backgroundSize: slide.getAttribute( 'data-background-size' ),
|
||||||
backgroundImage: slide.getAttribute( 'data-background-image' ),
|
backgroundImage: slide.getAttribute( 'data-background-image' ),
|
||||||
backgroundVideo: slide.getAttribute( 'data-background-video' ),
|
backgroundVideo: slide.getAttribute( 'data-background-video' ),
|
||||||
|
backgroundIframe: slide.getAttribute( 'data-background-iframe' ),
|
||||||
backgroundColor: slide.getAttribute( 'data-background-color' ),
|
backgroundColor: slide.getAttribute( 'data-background-color' ),
|
||||||
backgroundRepeat: slide.getAttribute( 'data-background-repeat' ),
|
backgroundRepeat: slide.getAttribute( 'data-background-repeat' ),
|
||||||
backgroundPosition: slide.getAttribute( 'data-background-position' ),
|
backgroundPosition: slide.getAttribute( 'data-background-position' ),
|
||||||
|
@ -696,11 +697,12 @@
|
||||||
// Create a hash for this combination of background settings.
|
// Create a hash for this combination of background settings.
|
||||||
// This is used to determine when two slide backgrounds are
|
// This is used to determine when two slide backgrounds are
|
||||||
// the same.
|
// the same.
|
||||||
if( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo ) {
|
if( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo || data.backgroundIframe ) {
|
||||||
element.setAttribute( 'data-background-hash', data.background +
|
element.setAttribute( 'data-background-hash', data.background +
|
||||||
data.backgroundSize +
|
data.backgroundSize +
|
||||||
data.backgroundImage +
|
data.backgroundImage +
|
||||||
data.backgroundVideo +
|
data.backgroundVideo +
|
||||||
|
data.backgroundIframe +
|
||||||
data.backgroundColor +
|
data.backgroundColor +
|
||||||
data.backgroundRepeat +
|
data.backgroundRepeat +
|
||||||
data.backgroundPosition +
|
data.backgroundPosition +
|
||||||
|
@ -1875,7 +1877,7 @@
|
||||||
/**
|
/**
|
||||||
* Toggles the auto slide mode on and off.
|
* Toggles the auto slide mode on and off.
|
||||||
*
|
*
|
||||||
* @param {Boolean} override Optional flag which sets the desired state.
|
* @param {Boolean} override Optional flag which sets the desired state.
|
||||||
* True means autoplay starts, false means it stops.
|
* True means autoplay starts, false means it stops.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2591,7 +2593,8 @@
|
||||||
background.setAttribute( 'data-loaded', 'true' );
|
background.setAttribute( 'data-loaded', 'true' );
|
||||||
|
|
||||||
var backgroundImage = slide.getAttribute( 'data-background-image' ),
|
var backgroundImage = slide.getAttribute( 'data-background-image' ),
|
||||||
backgroundVideo = slide.getAttribute( 'data-background-video' );
|
backgroundVideo = slide.getAttribute( 'data-background-video' ),
|
||||||
|
backgroundIframe = slide.getAttribute( 'data-background-iframe' );
|
||||||
|
|
||||||
// Images
|
// Images
|
||||||
if( backgroundImage ) {
|
if( backgroundImage ) {
|
||||||
|
@ -2608,6 +2611,17 @@
|
||||||
|
|
||||||
background.appendChild( video );
|
background.appendChild( video );
|
||||||
}
|
}
|
||||||
|
// Iframes
|
||||||
|
else if ( backgroundIframe ) {
|
||||||
|
var iframe = document.createElement( 'iframe' );
|
||||||
|
iframe.setAttribute('src', backgroundIframe);
|
||||||
|
iframe.style.width = '100%';
|
||||||
|
iframe.style.height = '100%';
|
||||||
|
iframe.style.maxHeight = '100%';
|
||||||
|
iframe.style.maxWidth = '100%';
|
||||||
|
|
||||||
|
background.appendChild( iframe );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user