html – Reveal.js iframe背景

html – Reveal.js iframe背景,第1张

概述我希望在reveal.js演示文稿中将嵌入式iframe设置为全屏(或全屏的调整百分比). This讨论暗示我可以将iframe设置为背景,但这会返回默认背景: <section data-background="http://viz.healthmetricsandevaluation.org/fgh"></section> 我也尝试将iframe放在带有类拉伸的div中,但它只占屏幕的一定百 我希望在reveal.Js演示文稿中将嵌入式iframe设置为全屏(或全屏的调整百分比). This讨论暗示我可以将iframe设置为背景,但这会返回默认背景:

<section data-background="http://viz.healthmetricsandevaluation.org/fgh"></section>

我也尝试将iframe放在带有类拉伸的div中,但它只占屏幕的一定百分比:

<div class = "stretch">     <iframe wIDth="100%" height="100%" src="http://viz.healthmetricsandevaluation.org/fgh"></iframe></div>
解决方法 要回答有关与背景iframe交互的问题,请执行以下 *** 作:

使用reveal.Js上的dev分支来获取data-background-iframe功能.实现这个小补丁以与iframe交互,直到合并类似的东西.

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;           }       }   }}

需要说明的是,添加的两行是:

document.querySelector('.reveal > .backgrounds').style['z-index'] = 0; // reset when not in iframedocument.querySelector('.reveal > .backgrounds').style['z-index'] = 1; // set when in iframe

参考:https://github.com/hakimel/reveal.js/pull/1029#issuecomment-65373274

总结

以上是内存溢出为你收集整理的html – Reveal.js iframe背景全部内容,希望文章能够帮你解决html – Reveal.js iframe背景所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1043672.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存