我正在将youtube iframe嵌入到bxslider中。 当您从一个幻灯片转到另一个幻灯片时,由于某种原因,iframe 将保持在 ie 中所有内容的顶部。
Chrome 中的行为(对于相同的 html 和 css)是我想要的!
请参阅链接:www.torontochinesesoccer.com/brands
div(包括视频所在的div)都是相对定位的。 即对待 iframe 的方式不同吗?
尝试在iframe上使用wmode="Opaque",或者你可以使用jquery代码
$('iframe').each(function()
{var url = $(this).attr("src");
var result = url.search(/youtube/i);
if(result!=-1)
{result = url.indexOf('?');
if(result!=-1)
{$(this).attr("src",url+"&wmode=transparent");
} else {$(this).attr("src",url+"?wmode=transparent");}
}
});
});
您可以在此处找到更多信息 - http://www.scorchsoft.com/news/youtube-z-index-embed-iframe-fix