-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Iframe background support #1029
Conversation
Thanks! |
Is there a way to have the background iframes react to click and hover events? |
As a dirty solution, you could tweak the
|
Makes sense -- clean enough for me. Thanks! |
Is there a better solution than this? Within the function showSlide( slide ) {
// ...
if( background ) {
// ...
document.querySelector('.reveal > .backgrounds').style['z-index'] = 0;
// ...
if( background.hasAttribute( 'data-loaded' ) === false ) {
// ...
if( backgroundImage ) {
// ...
}
// ...
else if ( backgroundIframe ) {
// ...
document.querySelector('.reveal > .backgrounds').style['z-index'] = 1;
}
}
}
} The two lines added were just: document.querySelector('.reveal > .backgrounds').style['z-index'] = 0; // reset when not in iframe
document.querySelector('.reveal > .backgrounds').style['z-index'] = 1; // set when in iframe |
+1 to @AlJohri's suggestion to adjust the z-index for iframe's exclusively |
@AlJohri The solution seems good enough but presents two problems:
|
@AlJohri Instead of changing the Reveal library, I think the best way to implement this hack is to listen for the 'slidechanged' event and then change the backgrounds z-index if the current slide uses an iFrame background. For example, if using Reveal in combination with jQuery, I would use the following to make background iFrames reactive: Reveal.addEventListener('slidechanged', function(event) {
if($(event.currentSlide).attr('data-background-iframe')) {
$('.reveal > .backgrounds').css('z-index', 1);
} else {
$('.reveal > .backgrounds').css('z-index', 0);
}
}); Maybe @hakimel will add an option to making iFrame backgrounds active. |
Hi there,
Regarding #751 , I made few changes to handle an
Iframe
as a background through thedata-background-iframe
attribute:This way you can use any webpages as a background.
Cheers,
Lutangar.