You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a minor issue, but I was wondering if there is a way to define a static picture (png or svg) as a fallback option for an iframe in a reveal.js presentation? Sometimes it could be that some external policy is blocking the loading of the iframe and it would be nice to have something instead on the slide then. My use case would be displaying my personal webpage at the end of the presentation (with an iframe it would always show the up-to-date version).
I don't think there is a built in option in revealjs to do that. There is one feature request for something like it in order to have a fallback image on print: hakimel/reveal.js#2795
Maybe you could add such feature in your presentation using JS by changing the <iframe> to an <img> on some conditions ?
some custom JS can be added using revealjs hooks, or bare JS and setting includes
An iframe element never has fallback content, as it will always create a nested browsing context, regardless of whether the specified initial contents are successfully used.
so that is not something built in spec a fallback for iframe
if there is an easy way to do this, we could try adding, but blocking policy cannot really be detected at build time, and only run time (hence a JS solution in browser)
Activity
cderv commentedon Jun 6, 2022
I don't think there is a built in option in revealjs to do that. There is one feature request for something like it in order to have a fallback image on print: hakimel/reveal.js#2795
Maybe you could add such feature in your presentation using JS by changing the
<iframe>to an<img>on some conditions ?some custom JS can be added using revealjs hooks, or bare JS and setting includes
Also from https://dev.w3.org/html5/pf-summary/embedded-content-0.html
so that is not something built in spec a fallback for iframe
if there is an easy way to do this, we could try adding, but blocking policy cannot really be detected at build time, and only run time (hence a JS solution in browser)
maxpel commentedon Jun 6, 2022
thanks for the fast answer and the useful information!
I guess something along the lines of these solutions could work in that case: https://stackoverflow.com/questions/24529625/how-to-check-if-iframe-is-visible-on-page-using-jquery