Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Vimeo iframe作为背景_Javascript_Jquery_Html_Css_Ajax - Fatal编程技术网

Javascript Vimeo iframe作为背景

Javascript Vimeo iframe作为背景,javascript,jquery,html,css,ajax,Javascript,Jquery,Html,Css,Ajax,我将制作一个以视频为背景的网站 我想从vimeo加载视频,但我还没有找到最好的全屏方式 我正在尝试将css添加到iframe中,但它根本不起作用: iframe{ width: 100%; height: 100%; } 你们中有谁知道不使用插件或html5来避免IE问题而将其作为背景嵌入的最佳方法吗 谢谢大家! 给你: 将其包装在div中,并将其设置为100%,100% iframe, div { width: 100%; height: 100%;

我将制作一个以视频为背景的网站

我想从vimeo加载视频,但我还没有找到最好的全屏方式

我正在尝试将css添加到iframe中,但它根本不起作用:

iframe{
     width: 100%;
     height: 100%;
}
你们中有谁知道不使用插件或html5来避免IE问题而将其作为背景嵌入的最佳方法吗

谢谢大家!

给你:

将其包装在div中,并将其设置为100%,100%

iframe, div {
     width: 100%;
     height: 100%;
}
HTML:

演示:


尝试使用ID标识此bg iframe:

<iframe id="bgiframe">...</iframe>
z-index:-1用于将此元素置于其他元素下。
背景:透明对于每一个其他元素来说都是看穿并将视频作为背景

这可以是一个例子:

可能,但这与我的question@fxg没问题^很乐意帮忙@Neal:是的,但是背景中的iframe没有;)我收到一条“此页面不在这里”的消息。你的演示现在有一个DIV覆盖了iframe。。。您无法停止视频或视频上的任何其他内容…@Neal Af问题指出
有一个视频作为背景
imo,这意味着iframe上有一个覆盖的div/内容持有者。
body {
    overflow: hidden;
}
iframe {
     position: absolute;
     z-index: 1;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
}
#container {
     position: absolute;
     z-index: 2;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     overflow: auto;
}
<iframe src="http://player.vimeo.com/video/47922974" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <p><a href="http://vimeo.com/47922974">Jape 'Scorpio'</a> from <a href="http://vimeo.com/fergalbrennan">Fergal Brennan</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<iframe class="fullvideo">
iframe.fullvideo {
width: 100%;
height: 100%;
}
<iframe id="bgiframe">...</iframe>
html, body, p, div, span, table, td 
/* Add other elements... These are explicit defined since ie6/7 doesn't support * selector */ 
{
   z-index: inherit;
   background: transparent; /* this is important to see-through normal elements */
}

#bgiframe {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding 0;
    margin: 0;
    border: 0;
    width: 100%; height: 100%;
    z-index: -1;
}