【问题标题】:Why is this iframe (youtube embed) behaving differently in chrome and ie?为什么这个 iframe (youtube embed) 在 chrome 和 ie 中表现不同?
【发布时间】:2012-09-23 08:25:39
【问题描述】:

我在 bxslider 中嵌入了 youtube iframe。当您从一张幻灯片转到另一张幻灯片时,出于某种原因,iframe 保持在 ie 中所有内容的顶部。

chrome 中的行为(对于相同的 html 和 css)是我想要的!

请查看链接:www.torontochinesesoccer.com/brands

div(包括视频所在的那个)都是相对定位的。 ie 对 iframe 的处理方式不同吗??

【问题讨论】:

    标签: jquery internet-explorer iframe bxslider


    【解决方案1】:

    尝试在你的 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-21
      • 1970-01-01
      • 2015-08-25
      • 2014-04-25
      • 2011-03-13
      • 1970-01-01
      • 2011-12-06
      • 1970-01-01
      相关资源
      最近更新 更多